Intent复习回顾

来源:互联网 发布:windows.h x86 x64 编辑:程序博客网 时间:2024/05/16 12:58

Intent代表了一个Activity启动另一个Activity的意图。

一、Intent对象详解

使用Intent启动系统组件

Android采用一致的Intent意图启动:Activity、Service、BroadcastReceiver,还可以与被启动组件交换信息。

常见的启动方法:

Activity:startActivity(Intent intent)、startActivityForResult(Intent intent,int requestCode)

Service:startService(Intent service)、bindService(Intent intent,ServiceConnection conn,int flag)

BroadcastReceiver:sendBroadcast(Intent intent)

Intent对象包括常用的7种属性:

Component、Action、Category、Data、Type、Extra、Flag

Intent的属性及intent-filter配置

Android根据Intent来启动具体的哪个组件,取决于Intent的各个属性。

Component属性


0 0