Intent学习
来源:互联网 发布:distinct sql 用法 编辑:程序博客网 时间:2024/05/29 18:43
简介:
intent 可以启动一个activity,broadcast或者service,实现一种运行时的绑定。
intent 结构
最重要的两个信息是
action -- The general action to be performed, such as
ACTION_VIEW
,ACTION_EDIT
,ACTION_MAIN
, etc.data -- The data to operate on, such as a person record in the contacts database, expressed as a
Uri
category -- Gives additional information about the action to execute. For example,
CATEGORY_LAUNCHER
means it should appear in the Launcher as a top-level application, whileCATEGORY_ALTERNATIVE
means it should be included in a list of alternative actions the user can perform on a piece of data.
type -- 指定传递的数据类型(使用 MIME type)
component -- 显式的指定了处理intent的组件
extras -- This is a
Bundle
of any additional information. This can be used to provide extended information to the component. For example, if we have a action to send an e-mail message, we could also include extra pieces of data here to supply a subject, body, etc.总而言之, the set of actions, data types, categories, and extra data defines a language for the system allowing for the expression of phrases such as “call john smith's cell
setComponent(ComponentName)
或者setClass(Context, Class),常用于启动同一个应用内的活动。
隐式:Intent定义好信息后,由系统的Intent resolution来进行匹配, which maps an Intent to an Activity
, BroadcastReceiver
, or Service
(or sometimes two or more activities/receivers) that can handle it.
Intent resolution 将Intent与安装好的应用包中的意图过滤器进行比对从而确定谁来响应。
只比对三个信息:action, type, and category
- Intent学习
- Intent学习
- Intent学习
- Intent学习
- Intent学习
- intent与intent filter学习
- 学习Intent的使用
- 学习Intent的使用
- Intent机制学习笔记
- intent学习总结
- Intent学习笔记整理
- Intent学习总结
- Intent学习笔记
- Intent初级学习
- Android学习笔记--Intent
- Android Intent 机制学习
- 5.Intent学习 实例
- Android学习 - Intent使用
- PHP学习路线
- java获取系统时间
- Jquery(八)插播:jQuery实施方案
- cocos2d-x中用Eclipse打包Apk过程及步骤(c++)
- sql动态添加列
- Intent学习
- VS2010 C++ 操作Excel表格的编程实现
- 【Android知识点精讲】(2)2D绘制与控件绘制
- 侵入式智能指针
- Leetcode Letter Combinations of a Phone Number
- LeetCode(169) Majority Number
- 计算机书记推荐
- Maven针对不同的环境使用Profile完成打包部署
- Jquery(九)jquery工具函数