700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > android学习笔记---35_Intent意图 深入解剖

android学习笔记---35_Intent意图 深入解剖

时间:2020-03-14 01:31:41

相关推荐

android学习笔记---35_Intent意图 深入解剖

1.35_Intent深入解剖

----------------------------

2.Android基本的设计理念是鼓励减少组件间的耦合,因此Android提供了Intent (意图) ,Intent提供了一种通用

的消息系统,它允许在你的应用程序与其它的应用程序间传递Intent来执行动作和产生事件。使用Intent可以激活

Android应用的三个核心组件:活动、服务和广播接收器。

Intent可以划分成显式意图和隐式意图。

显式意图:调用Intent.setComponent()或Intent.setClass()方法明确指定了组件名的Intent为显式意图,显式意

图明确指定了Intent应该传递给哪个组件。

隐式意图:没有明确指定组件名的Intent为隐式意图。 Android系统会根据隐式意图中设置的动作(action)、类别

(category)、数据(URI和数据类型)找到最合适的组件来处理这个意图。

<intent-filter>

<action android:name="android.intent.action.CALL" />

<category android:name="android.intent.category.DEFAULT" />

<data android:scheme="tel" />

</intent-filter>

<intent-filter>

<action android:name="android.intent.action.CALL" />

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。