开发者

Why Label Intent Filters?

Just getting my hands around intent filters, and I've noticed a rather hit and miss approach to labeling inten开发者_Python百科t-filters using android:label in both sample code and other online sources, yet haven't been able to find a definitive explanation for the purpose of labeling.

Can anyone point me in the right direction?

Thanks,

Paul


Basic example:

  • You have an app that opens text files (an activity with intent filters to do so)
  • Tere are more than one app to do so.
  • When the user opens a text file it will be presented with an options menu which allows him/her to decide which activity to use in order to open the text file.
  • The string you put in android:label for the intent filter is the string that the user will see in the alternatives menu.

It's explained in the official documentation.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜