category

SYNTAX:
<category android:name="string" />
CONTAINED IN:
<intent-filter>
DESCRIPTION:
Adds a category name to an intent filter. See  Intents and Intent Filters for details on intent filters and the role of category specifications within a filter.
ATTRIBUTES:
android:name
The name of the category. Standard categories are defined in the  Intent class as  CATEGORY_nameconstants. The name assigned here can be derived from those constants by prefixing " android.intent.category." to the  name that follows  CATEGORY_. For example, the string value for  CATEGORY_LAUNCHER is " android.intent.category.LAUNCHER".

Note: In order to receive implicit intents, you must include the CATEGORY_DEFAULT category in the intent filter. The methods startActivity() and startActivityForResult() treat all intents as if they declared the CATEGORY_DEFAULT category. If you do not declare it in your intent filter, no implicit intents will resolve to your activity.

Custom categories should use the package name as a prefix, to ensure that they are unique.

INTRODUCED IN:
API Level 1
SEE ALSO:
<action> 

<data>


句法:
<类别 的Android:名称 = 字符串 />
包含在:
<意图过滤器>
描述:
添加一个类别名称,一个意图过滤器。见  意图和意图过滤器上的意图过滤器的详细信息和类别规格的过滤器中的作用。
属性:
安卓:名称
的类别的名称。标准类别的定义  意图CATEGORY_  常量。这里分配的名字可以从这些常数由前缀派生“  android.intent.category。 ” 到  名称后面 CATEGORY_。例如,对于字符串值 CATEGORY_LAUNCHER是“  android.intent.category.LAUNCHER ”。

注:为了获得隐含的意图,你必须包括 CATEGORY_DEFAULT的意图过滤类别。方法startActivity()和 startActivityForResult()把所有的意图,如果他们宣布CATEGORY_DEFAULT类别。如果你没有在你的意图过滤器声明它,没有隐含意图将解析为您的活动。

自定义类别应该使用包名作为前缀,以确保它们是唯一的。

介绍了:
API级别1
也可以看看:
<操作> 
<数据>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值