- البنية:
<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>
- description:
- تُحدِّد أنواع النوايا التي يمكن لمستقبل البث أو النشاط أو الخدمة الردّ عليها. يعلن فلتر الأهداف عن إمكانات المكوّن
الرئيسي: ما يمكن أن يفعله النشاط أو الخدمة وأنواع
البث التي يمكن لجهاز الاستقبال معالجتها.
ويفتح المكوّن لتلقّي النوايا من النوع المعلَن عنه مع فلترة تلك التي ليست مفيدة للمكوّن. يتم وصف معظم محتوى الفلتر من خلال عناصره الفرعية:
لمناقشة أكثر تفصيلاً عن الفلاتر، يُرجى الاطّلاع على Intents وIntent Filters وIntent filters في قسم النظرة العامة على بيان التطبيق.
- السمات:
android:icon
- رمز يمثّل النشاط الرئيسي أو الخدمة أو جهاز استقبال البث
عندما يتم عرض هذا المكوّن للمستخدم على أنّه يمتلك
القدرة الموضّحة في الفلتر
يتم ضبط هذه السمة كمرجع لمورد قابل للرسم يحتوي على تعريف الصورة. القيمة التلقائية هي الرمز الذي تم ضبطه بواسطة سمة
icon
للمكوّن الرئيسي. إذا لم يحدّد العنصر родительский رمزًا، يكون الرمز التلقائي هو الرمز الذي يحدّده العنصر<application>
.لمزيد من المعلومات عن رموز فلاتر الأهداف، اطّلِع على القسم الرموز والعلامات في النظرة العامة على بيان التطبيق.
android:label
- تصنيف يسهل على المستخدم قراءته للمكوّن الرئيسي ويُستخدَم هذا التصنيف، بدلاً من
التصنيف الذي يضبطه المكوّن الرئيسي، عند عرض المكوّن
للمستخدم على أنّه يمتلك الإمكانية الموضّحة في الفلتر.
يتم ضبط التصنيف كإشارة إلى مورد سلسلة حتى تتمكّن من ترجمة السلسلة مثل سلاسل النصوص الأخرى في واجهة المستخدم. ومع ذلك، لتسهيل عملية تطوير التطبيق، يمكن أيضًا ضبطه كسلسلة غير مفسَّرة.
القيمة التلقائية هي التصنيف الذي يضبطه المكوّن الرئيسي. إذا لم يحدِّد العنصر الرئيسي تصنيفًا، يكون التصنيف التلقائي هو التصنيف الذي تم ضبطه من خلال سمة
label
لعنصر<application>
.لمزيد من المعلومات عن تصنيفات فلاتر الأهداف، اطّلِع على القسم الرموز والتصنيفات في النظرة العامة على بيان التطبيق.
android:priority
- الأولوية الممنوحة للمكوِّن الرئيسي في ما يتعلّق
بمعالجة النوايا من النوع الموضّح في الفلتر لهذه السمة
معنى لكل من الأنشطة وأجهزة استقبال البث.
- تقدّم هذه السمة معلومات عن مدى قدرة نشاط معيّن على الاستجابة لطلب يتطابق مع الفلتر، مقارنةً بالأنشطة الأخرى التي يمكنها أيضًا الاستجابة للطلب. عندما يمكن تنفيذ نية من خلال عدة أنشطة ذات أولويات مختلفة، لا يأخذ Android في الاعتبار سوى الأنشطة التي تتضمن قيم أولوية أعلى كأهداف محتملة للنية.
وتتحكّم هذه القيمة في ترتيب تنفيذ أجهزة استقبال البث لتلقّي رسائل البث، مع استدعاء تلك التي تحتوي على قيم أولوية أعلى قبل تلك التي تحتوي على قيم أقل. لا ينطبق الترتيب إلا على الرسائل المتزامنة. ويتم تجاهله للرسائل غير المتزامنة.
لا تستخدِم هذه السمة إلا إذا كنت بحاجة إلى فرض ترتيب محدّد لتلقّي البثّات أو إذا كنت تريد إجبار Android على تفضيل أحد الأنشطة على الأنشطة الأخرى.
القيمة عدد صحيح، مثل
100
. تكون الأرقام الأعلى برمجةً لها أولوية أعلى. تكون القيمة التلقائية0
.في بعض الحالات، يتم تجاهل الأولوية المطلوبة ويتم حصر القيمة ب
0
. يحدث ذلك في الحالات التالية:- يطلب تطبيق غير مفوَّض أي أولوية > 0.
- يطلب تطبيق مميّز الحصول على الأولوية >0 لملف
ACTION_VIEW
أو ACTION_SEND
أو ACTION_SENDTO
أو ACTION_SEND_MULTIPLE
.
لمزيد من المعلومات، يُرجى الاطّلاع على
setPriority()
. android:order
ترتيب معالجة الفلتر عند تطابق فلاتر متعددة
تختلف دالة
order
عن دالةpriority
من حيث أنّpriority
تُطبَّق على مستوى التطبيقات، في حين أنّorder
تزيل الغموض عن فلاتر المطابقة المتعدّدة في تطبيق واحد.عندما يمكن أن تتطابق فلاتر متعدّدة، استخدِم نية موجّهة بدلاً من ذلك.
القيمة عدد صحيح، مثل
100
. تتم مطابقة الأرقام الأعلى أولاً. تكون القيمة التلقائية0
.تمّ تقديم هذه السمة في مستوى واجهة برمجة التطبيقات 28.
android:autoVerify
- ما إذا كان نظام Android بحاجة إلى التحقّق من أنّ ملف روابط التنقل إلى مواد العرض الرقمية بتنسيق JSON من المضيف المُحدَّد يتطابق مع هذا التطبيق.
لمزيد من المعلومات، يُرجى الاطّلاع على مقالة التحقّق من روابط تطبيقات Android.
تكون القيمة التلقائية
false
.تمّ تقديم هذه السمة في المستوى 23 من واجهة برمجة التطبيقات.
- تمّت إتاحة هذه الميزة لأول مرة في:
- المستوى 1 من واجهة برمجة التطبيقات
- راجِع أيضًا:
<action>
<category>
<data>
<uri-relative-filter-group>
<intent-filter>
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],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)"]]