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>
name
attribute. The value must be the literal string value of an action, not the class constant.
<data>
scheme
,
host
,
port
,
path
, etc.) and MIME type.
<category>
name
attribute. The value must be the literal string value of an action, not the class constant.
PendingIntent.getActivity()
for anIntent
that starts anActivity
.PendingIntent.getService()
for anIntent
that starts aService
.PendingIntent.getBroadcast()
for aIntent
that starts anBroadcastReceiver
.