Intent探索
来源:互联网 发布:微电网储能优化 编辑:程序博客网 时间:2024/05/16 15:38
intent的分类
Intent分为两种,显式intent和隐式intent,显式intent直接指明了接收的Activity,隐式intent没有直接指出接收的Activity,而是需要去AndroidManifest.xml文件中去匹配。Activity匹配隐式intent的条件有三个,Action,Category,Data这三个条件均位于intent-filter标签。Android本身库中提供了标准的Action和Category库,定义了data的格式。
intent的官方描述
An intent is an abstract description of an operation to be performed. It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service.
An Intent provides a facility for performing late runtime binding between the code in different applications. Its most significant use is in the launching of activities, where it can be thought of as the glue between activities. It is basically a passive data structure holding an abstract description of an action to be performed.
常用的函数
构造函数
高频函数
intent-filter实例
<intent-filter> <action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.EDIT" /> <action android:name="android.intent.action.PICK" /> <category android:name="android.intent.category.DEFAULT" /> <data android:mimeType="vnd.android.cursor.dir/vnd.google.note" /> </intent-filter>
注意事项:
1. 隐式intent查询时的优先级为action->data->category
2. action的值就是一个字符串,可以随意设置,只要匹配就可以
- Intent探索
- 【Android学习笔记】Android中Intent的应用方法探索
- 【Android学习笔记】Android中Intent的应用方法探索
- [磨刀霍霍]Intent常用ACTION探索——发现uri
- 《Android 开发艺术探索》读书笔记三 Intent和IntentFilter详解
- 安卓学习(一)——Intent探索
- 探索Activity之启动Intent Flag和taskAffinity
- 探索
- 探索
- 探索
- intent
- Intent
- Intent
- Intent
- intent
- Intent
- intent
- Intent
- SSH自动登录脚本
- soot基础 -- 相关数据结构SootClass,SootMethod,SootBody,Unit的进一步说明
- 华为路由器BGP的路由控制和安全
- Window上编译最新版libCef(Branch 2704)
- 装配psycopg是出错:Error: pg_config executable not found
- Intent探索
- The system is running in low-graphics mode 解决方法Ubuntu
- CentOS splashimage
- Python字符串与数字拼接报错解决
- Mac: OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/h5py'
- 链表(java)
- AC自动机——病毒侵袭 ( HDU 2896 )
- 精典牛仔裤搭配方法
- 输入一个链表,从尾到头打印链表每个节点的值。