- 语法:
<category android:name="string" />
- 包含于:
<intent-filter>
- 说明:
- 向 Intent 过滤器添加类别名称。如需详细了解 Intent 过滤器和类别规范在过滤器中的作用,请参阅 Intent 和 Intent 过滤器。
- 属性:
android:name
- 类别的名称。标准类别在
Intent
类中定义为CATEGORY_name
常量。此处分配的名称可以根据这些常量推导出来,方法是在CATEGORY_
后跟的name
前面加上“android.intent.category.
”作为前缀。例如,CATEGORY_LAUNCHER
的字符串值为“android.intent.category.LAUNCHER
”。注意:为了接收隐式 intent,您必须在 intent 过滤器中添加
CATEGORY_DEFAULT
类别。startActivity()
和startActivityForResult()
方法将所有 intent 当作声明了CATEGORY_DEFAULT
类别一样对待。如果您没有在 Intent 过滤器中声明该类别,则任何隐式 Intent 都不会解析为您的 Activity。自定义类别应将软件包名称用作前缀,以确保它们的唯一性。
- 引入于:
- API 级别 1
- 另请参阅:
<action>
<data>
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2022-03-01。
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"没有我需要的信息"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"太复杂/步骤太多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"内容需要更新"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻译问题"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/代码问题"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"易于理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"解决了我的问题"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]