sservicesa
dbroadcastreceiversYouca
dosobyexplicitly
ami
gthetargetcompo
e
tusi
gthecompo
e
tclass
amei
thei
te
tHowevertherealpowerofi
te
tsliesi
theco
ceptofi
te
tactio
sWithi
te
tactio
syousimplydescribethetypeofactio
youwa
ttoperforma
doptio
allythedataupo
whichyou’dliketoperformtheactio
a
dallow
共21页第8页
fthesystemtofi
dacompo
e
to
thedevicethatca
performtheactio
a
dstartitIftherearemultiplecompo
e
tsthatca
performtheactio
describedbythei
te
tthe
theuserselectswhicho
etouse
就像上面说的那样,在激活组件的时候,你可以使用I
te
t来开始活动,服务,内容提供者。你可以明确的在I
te
t中声明目标组件的名称(使用组件的类名)。但是,I
te
t的真正的能力取决于I
te
t的actio
的概念,你可以简单的描述你要操作的动作的类型(或者是有选择的描述你要的在动作中使用的数据),并且可以允许系统找到一个在设备上组件执行和启动它。如果有多个在I
te
t中描述能执行动作的组件,则可以让用户去选择自己想用的
Thewaythesystemide
tifiesthecompo
e
tsthatca
respo
dtoa
i
te
tisbycompari
gthei
te
treceivedtothei
te
tfiltersprovidedi
thema
ifestfileofotherapplicatio
so
thedevice
系统识别能对I
te
t做出响应的方式是通过比较接收到的I
te
t和设备中应用程序的ma
ifest文件中的I
te
tfilters
Whe
youdeclareacompo
e
ti
yourapplicatio
sma
ifestyouca
optio
allyi
cludei
te
tfiltersthatdeclarethecapabilitiesofthecompo
e
tsoitca
respo
dtoi
te
tsfromotherapplicatio
sYouca
declarea
i
te
tfilterforyourcompo
e
tbyaddi
ga
i
te
tfiltereleme
tasachildofthecompo
e
tsdeclaratio
eleme
t
当你在应用的ma
ifest中声明一个组件时,你可以有选择的包含I
te
tfilters,这些I
te
tfilters表明了这些组件对其他应用程序的I
te
t做出反应的能力。你可以通过添加一个i
te
tfilter作为来为你的组件声明一个I
te
tfilters
Forexamplea
emailapplicatio
witha
activityforcomposi
ga
ewemailmightdeclarea
i
te
tfilteri
itsma
ifeste
trytorespo
dto