android api文档:intent阅读笔记
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)
android api文档:intent阅读笔记的更多相关文章
- API文档的阅读
API ——Application Programming Interface(应用程序编程接口) API是应用程序接口的意思,API是Java提供的基本编程接口,当使用Java语言进行编程时,不可能 ...
- Android API 文档 离线秒开方法
http://blog.csdn.net/haifengzhilian/article/details/39898627 也是最近才看Android开发,但是,它的API文档无论是在线还是离线的,实在 ...
- Android API文档
官方API文档: Android官网: https://developer.android.google.cn/index.html (不需要梯子) Android官网: https://develo ...
- android API文档查询---context、toast、SharedPreferences
/*查阅api ---context1.abstract AssetManager getAssets() Returns an AssetManager instance for the a ...
- Android,加载离线Android API文档缓慢问题!
解决方法:在host文件末添加如下信息! 0.0.0.0 www.googleapis.com 0.0.0.0 www.google.com 0.0.0.0 www.google-analytics. ...
- Android SDK文档如何查找
肯定很多人都会有疑问,怎样使用Android SDK 文档该如何使用呢?里面有那么多内容,又全是英文的,接下来告诉大家. 以下内容来自网络. ----------------------------- ...
- 提高打开Android本地文档的速度
非常多Android开发人员在參考Android官方API时,都有一个令人头疼的问题:打开一个index.html平均都须要几分钟甚至更长.尤其是在打开API 8以上的版本号的时候.难道是网速不够好? ...
- Android多媒体--MediaCodec 中文API文档
*由于工作需要,需要利用MediaCodec实现Playback及Transcode等功能,故在学习过程中翻译了Google官方的MediaCodec API文档,由于作者水平限制,文中难免有错误和不 ...
- Android浏览本地 API文档 + 解决页面加载慢的问题
火狐浏览器安装离线浏览插件: 用浏览器打开index.html文件,你会发现加载的很慢,原因你懂的,为此,我们可以通过离线的方式 查看本地API文档,用火狐浏览器 + Work Offline插 ...
随机推荐
- map的常见用法
map的常见用法 map 是什么? map是一组键值对的组合,通俗理解类似一种特殊的数组,a[key]=val,只不过数组元素的下标是任意一种类型,而且数组的元素的值也是任意一种类型.有点类似pyth ...
- KNN-综合应用
本文代码均来自<机器学习实战> 这里讲了两个例子,datingclass 和 figureclass,用到的都是KNN,要调用这两个例子的话就在代码末尾加datingClassTest() ...
- Linux文档整理之【Jenkins+Docker自动化部署.Net Core】
这次整理的文档是Jenkins+Docker实现自动化部署,很早之前就写的,今天有时间就搬到博客园做个记录. Jenkins是基于Java开发的一种持续集成工具,主要用于持续.自动的构建/测试软件等相 ...
- Hack the box: Bastion
介绍 目标:10.10.10.134 (Windows) Kali:10.10.16.65 In conclusion, Bastion is not a medium box. But it wou ...
- 基于AliOS的车载小程序
4月16日上海国际车展首日,阿里巴巴表示正在研发基于AliOS的车载小程序.同时还展出AI HUD.AI驾驶舱等最新技术,AliOS表示正在构建一个可持续发展的整合平台. 阿里方面表示,作为小程序在车 ...
- laravel-admin利用ModelTree实现对分类信息的管理
根据laravel的基本操作步骤依次完成如下操作:主要是参考laravel-admin内置的Menu菜单管理的功能,利用ModelTree实现业务中的Tree数据管理. 1. 创建模型 php art ...
- Ubuntu18.04 安装redis
Redis是常用基于内存的Key-Value数据库,比Memcache更先进,支持多种数据结构,高效,快速.用Redis可以很轻松解决高并发的数据访问问题:作为实时监控信号处理也非常不错. 安装red ...
- samba服务及vsftpd服务
如何配置多个网卡 第一步: 打开设置,选择网络驱动器添加 第二步: ip a 查看网卡是否添加成功 第三步: 打开刚添加的网卡配置文件(注意,你刚添加的网卡是没有配置文件的,需要去复制一份到/etc/ ...
- 遍历获取html页面所有元素的id
因为要写一个权限管理系统精确到每个标签.以前用过的是给每个标签加权限判断的代码.但感觉这种方式太麻烦和落后,向让页面加载时自动把每个标签的id扫描到并保存到数据库.通过id控制.研究了下实现代码如下: ...
- PAT Basic 1066 图像过滤 (15 分)
图像过滤是把图像中不重要的像素都染成背景色,使得重要部分被凸显出来.现给定一幅黑白图像,要求你将灰度值位于某指定区间内的所有像素颜色都用一种指定的颜色替换. 输入格式: 输入在第一行给出一幅图像的分辨 ...