Android中的Intent显式与隐式
来源:互联网 发布:钢笔 知乎 编辑:程序博客网 时间:2024/06/02 06:43
一.Intent用于启动组件的相关方法
1.Activity
startActivity(Intent intent)
startActivityForResult(Intent intent,int requestCode)
2.Service
ComponentName startService(Intent service)
boolean bindService(Intent service,ServiceConnection conn, int flags)
3.BroadcastReceiver
sendBroadcast(Intent intent)
sendBroadcast(Intent intent, String receiverPermission)
sendOrderedBroadcast(Intent intent,String receiverPermission, BroadcastReceiver resultReceiver,Handler scheduler,int initialCode,String initialData,Bundle InitialExtras)
sendOrderedBroadCast(Intent intent,String receiverPermission)
sendStickyBroadcast(Intent intent)
sendStickyOrderdBroadcast(Intent intent, BroadcastReceiver resultReceiver,Handler scheduler,int initialCode,String initialData,Bundle InitialExtras)
二.Intent的属性有7种,分别是:
1.Component - 用于明确指定要启动的目标组件,一般用于一个程序内指定启动的组件
2.Action - 描述接下来行为的“动作”
3.Category - 描述接下来行为的“类别”
4.Data - 描述启动组件所需要的额外数据
5.Type - 描述启动组件所需要的数据的类型
6.Extra - 携带的数据
7.Flag -
三.Intent的种类有两种:
一类是显式Intent,一类是隐式Intent。
1.显示Intent - 就是只需要用到Component属性的Intent,这样的Intent可以无视组件的intent-filter设置,不过需要知道所需启动组件所在的包和文件名,一般用于启动自己程序内的其他组件。
2.隐式Intent - 未设置Component属性的Intent,一般会需要设置Action,Category,Data,Type四个属性,然后Android根据这四个属性来决定哪个组件可以响应该“意图”。
阅读全文
0 0
- Android中的Intent显式与隐式
- Android中的显式 Intent和隐式 Intent
- 【Android】显式Intent与隐式Intent
- Android -- 显示Intent与隐式Intent的应用
- Android:Intent Filter 过滤器与隐式Intent
- Android中 intent 显式启动与隐式启动
- Android 中的 Intent 与 Intent Filter
- android中的Activity与Intent
- 显示Intent与隐式Intent
- 显式Intent与隐式Intent
- 显式Intent与隐式Intent
- android 显式Intent和隐式Intent
- Android:显式Intent和隐式Intent
- android学习记录(五)显式Intent与隐式Intent的功能与使用方法解析。
- Activity中的隐式Intent
- Intent隐式与显式
- Intent的显式与隐式
- Intent显式与隐显跳转
- 【模板】BFS
- HDU
- 论文笔记《Single Image Haze Removal Using Dark Channel Prior--Kaiming He》
- SpringMVC学习笔记总结
- maximum subarray
- Android中的Intent显式与隐式
- Sicily.1001
- 生活小记8
- sql语句中left join、inner join中的on与where的区别
- new/malloc和delete/free的区别
- VUE UI框架
- bzoj 1196 [HNOI2006]公路修建问题 二分+并查集
- 【模板】各种欧几里得
- 开发者账号申请以及所需资料