您的位置:首页 > 移动开发 > Android开发

android-Intents and Intent Filters and Common Intents

2015-11-24 11:14 459 查看
You can deliver a broadcast to other apps by passing an
Intent
to
sendBroadcast()
,
sendOrderedBroadcast()
,
or
sendStickyBroadcast()
.

Without a component name, the intent is implicit and
the system decides which component should receive the intent based on the other intent information (such as the action, data, and category—described below).

显示的意图和隐示的意图

<action>

Declares the intent action accepted, in the
name
attribute. The value must be the literal string value of an action, not the class constant.
<data>

Declares the type of data accepted, using one or more attributes that specify various aspects of the data URI (
scheme
,
host
,
port
,
path
, etc.) and MIME type.
<category>

Declares the intent category accepted, in the
name
attribute. The value must be the literal string value of an action, not the class constant.
For all activities, you must declare your intent filters in the manifest file.

PendingIntent.getActivity()
for
an
Intent
that starts an
Activity
.
PendingIntent.getService()
for
an
Intent
that starts a
Service
.
PendingIntent.getBroadcast()
for
a
Intent
that starts an
BroadcastReceiver
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: