intent是几大组件之间进行通信的组件。可以包含以下几个部分:

component:指明了处理该intent的对象。

Action类似于一个函数名,规定了其他部分的对应用法:

The action largely determines how the rest of the intent is structured — particularly the data and extras fields — much as a method name determines a set of arguments and a return value.

Data就是一个Uri:

In many cases, the data type can be inferred from the URI — particularly content: URIs, which indicate that the data is located on the device and controlled by a content provider Category:一个字符串: A string containing additional information about the kind of component that should handle the intent. Any number of category descriptions can be placed in an Intent object.

category:一个字符串

A string containing additional information about the kind of component that should handle the intent. Any number of category descriptions can be placed in an Intent object.

Extras: 是一组键值对:

Key-value pairs for additional information that should be delivered to the component handling the intent. Just as some actions are paired with particular kinds of data URIs, some are paired with particular extras. . These methods parallel those for Bundle objects

Flags一些常数字

Flags of various sorts. Many instruct the Android system how to launch an activity (for example, which task the activity should belong to) and how to treat it after it's launched (for example, whether it belongs in the list of recent activities).

不过以上这些组件在解析对应的intent时候,

Only three aspects of an Intent object are consulted when the object is tested against an intent filter:

action  data (both URI and data type)  category

The extras and flags play no part in resolving which component receives an intent.

与之对应的intentFilter,

A filter has fields that parallel the action, data, and category fields of an Intent object. An implicit intent is tested against the filter in all three areas. To be delivered to the component that owns the filter, it must pass all three tests.

(至于intent和intent filter详细的匹配规则可以参照具体的api文档,尤其是关于data的匹配规则相对复杂:

Since most available data is dispensed by content providers, filters that specify a data type but not a URI are perhaps the most common)

最新文章

  1. 自动加载dll,加载dll中程序集的信息。
  2. Linux添加新盘扩容空间
  3. Common Subsequence LCS
  4. ServletContext总结
  5. (6)redis 事务
  6. 使用C#中JavaScriptSerializer类将对象转换为Json格式数据
  7. 链表回文串判断&&链式A+B
  8. 在 linux x86-32 模式下分析内存映射流程
  9. !!流行的php面试题及答案
  10. python邮件发送接收
  11. java第十二次作业
  12. Angular集成UEditor
  13. 远程shell脚本执行工具类
  14. Django学习手册 - ORM 多对多表
  15. shell编程学习笔记(八):Shell中的if条件判断
  16. 什么是ORM?为啥要是用ORM?
  17. HDU 2647 Reward(拓扑排序,vector实现邻接表)
  18. vs2017 编译JRTPLIB
  19. HDU 3943 数位dp+二分
  20. 初识MVCSharp

热门文章

  1. python之入门
  2. 如何创建并发布一个 vue 组件
  3. luoguP4578_ [FJOI2018]所罗门王的宝藏
  4. 剑指offer-2:斐波那契数列
  5. 使用 dataset 管理数据(官网)
  6. Haproxy学习总结
  7. Pycharm新建第一个Django项目
  8. Windows Server IIS设置计划任务重启
  9. linux就该这么学.pdf
  10. solairs11与solairs10 ftp服务的区别