- 構文:
<category android:name="string" />
- 上位の要素:
<intent-filter>
- 説明:
- インテント フィルタにカテゴリ名を追加します。インテント フィルタの詳細やフィルタ内におけるカテゴリ指定の役割については、インテントとインテント フィルタをご覧ください。
- 属性:
android:name
- カテゴリの名前。標準カテゴリは、
Intent
クラス内でCATEGORY_name
定数として定義されています。ここで割り当てる名前は、各定数のCATEGORY_
の後ろにあるname
の前にandroid.intent.category.
を付加することで導出されます。たとえばCATEGORY_LAUNCHER
の場合、文字列値はandroid.intent.category.LAUNCHER
です。注: 暗黙的インテントを受け取るには、インテント フィルタ内に
CATEGORY_DEFAULT
カテゴリを含める必要があります。startActivity()
メソッドとstartActivityForResult()
メソッドは、CATEGORY_DEFAULT
カテゴリを宣言しているものとして、すべてのインテントを処理します。インテント フィルタ内で宣言していない場合、暗黙的インテントはアクティビティに変換されません。カスタム カテゴリを利用する場合は、パッケージ名をプレフィックスとして使用して一意になるようにしてください。
- 導入時の API レベル:
- API レベル 1
- 関連項目:
<action>
<data>
<カテゴリ>
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 UTC。"],[],[],null,["# <category\u003e\n\nsyntax:\n:\n\n ```xml\n \u003ccategory android:name=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)\n\ndescription:\n: Adds a category name to an intent filter. See\n [Intents and\n Intent Filters](/guide/components/intents-filters) for details on intent filters and the role of category\n specifications within a filter.\n\nattributes:\n:\n\n `android:name`\n : The name of the category. Standard categories are defined in the\n [Intent](/reference/android/content/Intent) class as `CATEGORY_`*name*\n constants. The name assigned here is derived from those constants\n by prefixing `android.intent.category.` to the\n *name* that follows `CATEGORY_`. For example,\n the string value for `CATEGORY_LAUNCHER` is\n `android.intent.category.LAUNCHER`.\n\n **Note:** To receive implicit intents, you must include the\n [CATEGORY_DEFAULT](/reference/android/content/Intent#CATEGORY_DEFAULT) category in the intent filter. The methods\n [startActivity()](/reference/android/app/Activity#startActivity(android.content.Intent)) and\n [startActivityForResult()](/reference/android/app/Activity#startActivityForResult(android.content.Intent, int)) treat all intents\n as if they declared the [CATEGORY_DEFAULT](/reference/android/content/Intent#CATEGORY_DEFAULT) category.\n If you don't declare it in your intent filter, no implicit intents can resolve\n your activity.\n\n\n For custom categories, use the package name as a prefix so\n that they are unique.\n\nintroduced in:\n: API Level 1\n\nsee also:\n: [\u003caction\u003e](/guide/topics/manifest/action-element)\n\n [\u003cdata\u003e](/guide/topics/manifest/data-element)"]]