- 構文:
<intent-filter android:icon="drawable resource" android:label="string resource" android:priority="integer" > ... </intent-filter>
- 上位の要素:
<activity>
<activity-alias>
<service>
<receiver>
<provider>
- 必須の下位の要素:
<action>
- 格納可能な下位の要素:
<category>
<data>
<uri-relative-filter-group>
- 説明:
- アクティビティ、サービス、またはブロードキャスト レシーバが応答できるインテントのタイプを指定します。インテント フィルタは、その親コンポーネントの機能(アクティビティまたはサービスが実行できることと、レシーバが処理できるブロードキャストのタイプ)を宣言します。
これにより、コンポーネントはアドバタイズされたタイプのインテントを受け取るようになり、そのコンポーネントにとって意味のないインテントはフィルタされます。フィルタのほとんどの内容は、そのサブ要素で記述されます。
フィルタの詳細については、インテントとインテント フィルタ、およびアプリ マニフェストの概要のインテント フィルタのセクションをご覧ください。
- 属性:
android:icon
- 親であるアクティビティ、サービス、ブロードキャスト レシーバを表すアイコン。該当のコンポーネントが、フィルタで記述されている機能を持つコンポーネントとしてユーザーに提示される際に表示されます。
この属性は、画像の定義を含むドローアブル リソースへの参照として設定されます。デフォルト値は、親コンポーネントの
icon
属性で設定されているアイコンです。親がアイコンを指定していない場合のデフォルト値は、<application>
要素で設定されているアイコンです。インテント フィルタのアイコンの詳細については、アプリ マニフェストの概要のアイコンとラベルのセクションをご覧ください。
android:label
- 親コンポーネントのユーザー可読形式のラベル。このラベルは、該当のコンポーネントが、フィルタで記述されている機能を持つコンポーネントとしてユーザーに提示される際に、親コンポーネントが設定しているラベルの代わりに使用されます。
ラベルは文字列リソースへの参照として設定します。そうすることで、ユーザー インターフェースの他の文字列と同じようにローカライズできるようになります。ただし、アプリ開発の便宜上、未加工の文字列として設定することもできます。
デフォルト値は、親コンポーネントによって設定されているラベルです。親がラベルを指定していない場合のデフォルト値は、
<application>
要素のlabel
属性で設定されているラベルです。インテント フィルタのラベルの詳細については、アプリ マニフェストの概要のアイコンとラベルのセクションをご覧ください。
android:priority
- フィルタで記述されたタイプのインテントの処理に関して親コンポーネントに付与される優先度。この属性は、アクティビティとブロードキャスト レシーバの両方にとって次のような意味を持ちます。
- フィルタと一致するインテントへのアクティビティの応答能力について、情報を提供します。これは、インテントに応答できる他のアクティビティとの比較に基づく応答能力です。優先度の異なる複数のアクティビティがインテントを処理できる場合、Android は高い優先度の値を持つアクティビティのみをインテントの潜在的ターゲットと見なします。
ブロードキャスト レシーバがブロードキャスト メッセージを受信する際の実行順序は制御され、優先度の高い値を持つレシーバは低い値を持つレシーバより先に呼び出されます。この順序は同期メッセージにのみ適用されます。非同期メッセージでは無視されます。
この属性は、ブロードキャストの受信順序を指定する必要がある場合や、Android に、あるアクティビティを他のアクティビティより優先させたい場合にのみ使用してください。
この値は整数です(
100
など)。数字が大きいほど優先度が高くなります。デフォルト値は0
です。状況によっては、リクエストした優先度が無視され、値が
0
に制限されることがあります。これは以下の場合に発生します。- 非特権アプリが 0 より大きな優先度をリクエストしている場合
- 特権アプリが
ACTION_VIEW
、ACTION_SEND
、ACTION_SENDTO
、またはACTION_SEND_MULTIPLE
に対して 0 より大きな優先度をリクエストしている場合
詳しくは、
setPriority()
をご覧ください。 android:order
複数のフィルタが一致するときのフィルタの処理順序。
priority
は複数のアプリ間で適用されますが、order
は複数の一致するフィルタを単一のアプリ内で明確にするという点において、order
はpriority
と異なります。複数のフィルタが一致する可能性がある場合は、代わりに有向インテントを使用してください。
この値は整数です(
100
など)。まず、数値の大きいものが一致します。デフォルト値は0
です。この属性は API レベル 28 で導入されました。
android:autoVerify
- 指定されたホストのデジタル アセット リンクの JSON ファイルがこのアプリと一致していることを、Android が検証する必要があるかどうか。
詳しくは、Android アプリリンクを検証するをご覧ください。
デフォルト値は
false
です。この属性は API レベル 23 で導入されました。
- 導入時の API レベル:
- API レベル 1
- 関連項目:
<action>
<category>
<data>
<uri-relative-filter-group>
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[null,null,["最終更新日 2025-07-27 UTC。"],[],[],null,["# <intent-filter\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cintent-filter android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:priority=\"integer\" \u003e\n ...\n \u003c/intent-filter\u003e\n ```\n\ncontained in:\n: [\u003cactivity\u003e](/guide/topics/manifest/activity-element)\n\n [\u003cactivity-alias\u003e](/guide/topics/manifest/activity-alias-element)\n\n [\u003cservice\u003e](/guide/topics/manifest/service-element)\n\n [\u003creceiver\u003e](/guide/topics/manifest/receiver-element)\n\n [\u003cprovider\u003e](/guide/topics/manifest/provider-element)\n\nmust contain:\n: [\u003caction\u003e](/guide/topics/manifest/action-element)\n\ncan contain:\n: [\u003ccategory\u003e](/guide/topics/manifest/category-element)\n\n [\u003cdata\u003e](/guide/topics/manifest/data-element)\n\n [\u003curi-relative-filter-group\u003e](/guide/topics/manifest/uri-relative-filter-group-element)\n\ndescription:\n\n: Specifies the types of intents that an activity, service, or broadcast receiver can respond to. An intent filter declares the capabilities of its parent component: what an activity or service can do and what types of broadcasts a receiver can handle.\u003cbr /\u003e\n\n It opens the component to receiving\n intents of the advertised type while filtering out those that aren't\n meaningful for the component.\n Most of the contents of the filter are described by its subelements:\n\n - [\u003caction\u003e](/guide/topics/manifest/action-element),\n - [\u003ccategory\u003e](/guide/topics/manifest/category-element),\n - [\u003cdata\u003e](/guide/topics/manifest/data-element), and\n - [\u003curi-relative-filter-group\u003e](/guide/topics/manifest/uri-relative-filter-group-element).\n\n \u003cbr /\u003e\n\n\n For a more detailed discussion of filters, see\n [Intents\n and Intent Filters](/guide/components/intents-filters) and the\n [Intent filters](/guide/topics/manifest/manifest-intro#ifs)\n section in the app manifest overview.\n\nattributes:\n:\n\n `android:icon`\n\n : An icon that represents the parent activity, service, or broadcast receiver when that component is presented to the user as having the capability described by the filter.\u003cbr /\u003e\n\n\n This attribute is set as a reference to a drawable resource\n containing the image definition. The default value is the icon set\n by the parent component's `icon` attribute. If the parent\n doesn't specify an icon, the default is the icon set by the\n [\u003capplication\u003e](/guide/topics/manifest/application-element) element.\n\n\n For more information about intent filter icons, see the\n [Icons and labels](/guide/topics/manifest/manifest-intro#iconlabel)\n section in the app manifest overview.\n\n `android:label`\n\n : A user-readable label for the parent component. This label, rather than the one set by the parent component, is used when the component is presented to the user as having the capability described by the filter.\u003cbr /\u003e\n\n\n The label is set as a reference to a string resource so that\n it can be localized like other strings in the user interface.\n However, as a convenience while you're developing the application,\n it can also be set as a raw string.\n\n\n The default value is the label set by the parent component. If the\n parent doesn't specify a label, the default is the label set by the\n [\u003capplication\u003e](/guide/topics/manifest/application-element) element's\n [label](/guide/topics/manifest/application-element#label) attribute.\n\n\n For more information about intent filter labels, see the\n [Icons and labels](/guide/topics/manifest/manifest-intro#iconlabel)\n section in the app manifest overview.\n\n `android:priority`\n : The priority given to the parent component with regard\n to handling intents of the type described by the filter. This attribute has\n meaning for both activities and broadcast receivers.\n\n - It provides information about how able an activity is to respond to an intent that matches the filter, relative to other activities that can also respond to the intent. When an intent can be handled by multiple activities with different priorities, Android considers only those with higher priority values as potential targets for the intent.\n - It controls the order in which broadcast receivers are executed to\n receive broadcast messages, with those having higher priority\n values being called before those having lower values. The order applies only\n to synchronous messages. It's ignored for asynchronous messages.\n\n\n Use this attribute only if you need to impose a specific order in\n which the broadcasts are received or want to force Android to prefer\n one activity over others.\n\n\n The value is an integer, such as `100`. Higher numbers have a\n higher priority. The default value is `0`.\n\n\n In certain circumstances the requested priority is ignored and the value\n is capped to `0`. This occurs when:\n\n - A non-privileged application requests any priority \\\u003e0.\n - A privileged application requests a priority \\\u003e0 for [ACTION_VIEW](/reference/android/content/Intent#ACTION_VIEW), [ACTION_SEND](/reference/android/content/Intent#ACTION_SEND), [ACTION_SENDTO](/reference/android/content/Intent#ACTION_SENDTO) or [ACTION_SEND_MULTIPLE](/reference/android/content/Intent#ACTION_SEND_MULTIPLE).\n\n\n For more information, see [setPriority()](/reference/android/content/IntentFilter#setPriority(int)).\n\n `android:order`\n\n : The order in which the filter is processed when multiple filters match.\n\n `order` differs from `priority` in that `priority` applies\n across apps, while `order` disambiguates multiple matching filters in a single\n app.\n\n When multiple filters can match, use a directed intent instead.\n\n The value is an integer, such as `100`. Higher numbers are matched first.\n The default value is `0`.\n\n This attribute was introduced in API level 28.\n\n `android:autoVerify`\n : Whether Android needs to verify that the Digital Asset Links JSON file from the specified\n host matches this application.\n\nintroduced in:\n: API level 1\n\nsee also:\n: [\u003caction\u003e](/guide/topics/manifest/action-element)\n\n [\u003ccategory\u003e](/guide/topics/manifest/category-element)\n\n [\u003cdata\u003e](/guide/topics/manifest/data-element)\n\n [\u003curi-relative-filter-group\u003e](/guide/topics/manifest/uri-relative-filter-group-element)"]]