Intents and Intent Filters
来源:互联网 发布:sql with 递归 编辑:程序博客网 时间:2024/05/16 04:32
三种应用程序基本组件——activity, service和broadcast receiver——是使用称为intent的消息来激活的。Intent消息传递是一种组件间运行时绑定的机制. intent是Intent对象, 它包含了需要做的操作的描述, 或者, 对于广播来说, 包含了正在通知的消息内容. 对于向这三种组件发送intent有不同的机制:
使用Context.startActivity() 或 Activity.startActivityForResult(), 传入一个intent来启动一个activity. 使用 Activity.setResult(), 传入一个intent来从activity中返回结果.
将intent对象传给Context.startService()来启动一个service或者传消息给一个运行的service. 将intent对象传给 Context.bindService()来绑定一个service.
将intent对象传给 Context.sendBroadcast(), Context.sendOrderedBroadcast(),或者Context.sendStickyBroadcast()等广播方法,则它们被传给 broadcast receiver.
在上述三种情况下, android系统会自己找到合适的activity, service, 或者 broadcast receivers来响应intent. 三者的intent相互独立互不干扰.
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- intents and intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- Intents and Intent Filters
- eclipse中启动tomcat设置tomcat内存大小
- 进度条和滑块的应用
- RichTextBox中模拟分栏显示RichTextBox中模拟分栏显示
- 常用适配器
- 更改控件外观
- Intents and Intent Filters
- 类的线程安全性
- vba 注释
- va_start va_end 的使用和原理
- Action/Data/CategoryExtras/Flags
- WinRAR v3.6以下版本存在安全漏洞
- SQL Server 2008 表变量参数(表值参数)用法
- netbeans开发桌面应用程序时使用自动资源管理的一些纠结
- 显式Intent和隐式Intentd