- بناء الجملة:
<activity-alias android:enabled=["true" | "false"] android:exported=["true" | "false"] android:icon="drawable resource" android:label="string resource" android:name="string" android:permission="string" android:targetActivity="string" > ... </activity-alias>
- الواردة في:
<application>
- يمكن أن يحتوي على:
<intent-filter>
<meta-data>
- description:
- اسم مستعار لنشاط، يحمله
targetActivity
. يجب أن يكون الهدف في نفس التطبيق مثل والاسم المستعار وتم الإعلان عنه قبل الاسم المستعار في البيان.يعرض العنوان البديل النشاط المستهدف ككيان مستقل، ويمكن أن يكون له مجموعة أغراض خاصة به والفلاتر. هم، بدلاً من فلاتر الأهداف على النشاط المستهدف نفسه، وتحديد الأهداف تنشيط الهدف من خلال العنوان البديل للبريد الإلكتروني وكيفية تأثير النظام يتعامل مع الاسم المستعار.
على سبيل المثال، قد تتضمن فلاتر الأهداف على العنوان البديل للبريد الإلكتروني تحديد
"android.intent.action.MAIN"
و"android.intent.category.LAUNCHER"
بوصة ، مما يؤدي إلى في مشغّل التطبيقات، على الرغم من عدم تعمل الفلاتر على النشاط المستهدف نفسه على تعيين هذه العلامات.باستثناء
targetActivity
،<activity-alias>
السمات هي مجموعة فرعية من سمات<activity>
. بالنسبة إلى السمات في المجموعة الفرعية، لا يتم نقل أي من القيم المحددة للهدف إلى الاسم المستعار. ومع ذلك، بالنسبة للسمات غير الموجودة في المجموعة الفرعية، فإن القيم المعينة فإن النشاط المستهدف ينطبق أيضًا على الاسم المستعار. - :
android:enabled
- ما إذا كان بإمكان النظام إنشاء مثيل للنشاط الهدف من خلال
الاسم المستعار هذا.
"true"
إذا كان ذلك ممكنًا، و"false"
إذا لم يكن ممكنًا. القيمة التلقائية هي"true"
.العنصر
<application>
له خاصية سمةenabled
التي تنطبق على الكل مكونات التطبيق، بما في ذلك الأسماء المستعارة للأنشطة. تشير رسالة الأشكال البيانية<application>
و<activity-alias>
يجب أن يكون كل من السمتين"true"
حتى يتمكن النظام من إنشاء مثيل النشاط المستهدف من خلال الاسم المستعار. إذا كان أي منهما"false"
، يتم استخدام الاسم المستعار لا يعمل. android:exported
- ما إذا كانت مكونات التطبيقات الأخرى يمكنها إطلاق النشاط المستهدف
من خلال الاسم المستعار هذا.
"true"
إذا أمكن، و"false"
إذا لم يكن ممكنًا. إذا كانت"false"
، لا يمكن إطلاق النشاط الهدف من خلال العنوان البديل للبريد الإلكتروني إلا من خلال مكونات التطبيق ذاته مثل الاسم المستعار أو التطبيقات التي لها نفس معرّف المستخدم.تعتمد القيمة التلقائية على ما إذا كان الاسم المستعار يحتوي على فلاتر أهداف. تشير رسالة الأشكال البيانية يعني عدم وجود أي فلاتر أنه يمكن استدعاء النشاط من خلال الاسم المستعار فقط من خلال تحديد اسم الاسم المستعار بدقة. هذا يعني أن الاسم المستعار مخصص للاستخدام الداخلي للتطبيقات فقط، نظرًا لأن هناك آخرين لا يعرفون اسمه. إذًا، القيمة التلقائية هي
"false"
. من ناحية أخرى، يعني وجود عامل تصفية واحد على الأقل أن الاسم المستعار مخصصة للاستخدام الخارجي، لذا فإن القيمة التلقائية هي"true"
. android:icon
- رمز للنشاط المستهدَف عند عرضه على المستخدمين من خلال العنوان البديل للبريد الإلكتروني
لمزيد من المعلومات، يُرجى الاطّلاع على صفة العنصر
<activity>
السمةicon
. android:label
- يشير إلى تصنيف سهل القراءة للمستخدم على العنوان البديل عندما يتم عرضه للمستخدمين من خلال الاسم المستعار.
لمزيد من المعلومات، يُرجى الاطّلاع على صفة العنصر
<activity>
السمةlabel
. android:name
- اسم فريد للعنوان البديل: يشبه الاسم اسم الفئة المؤهلة. ولكن على عكس اسم النشاط المستهدف، يكون الاسم المستعار عشوائيًا. ولا يشير إلى فئة فعلية.
android:permission
- اسم الإذن الذي يجب أن يتوفر لدى العملاء لبدء النشاط المستهدف
أو حمله على القيام بشيء ما باستخدام الاسم المستعار. إذا قام المتصل بـ
startActivity()
أوstartActivityForResult()
لم يتم منح الإذن المحدّد، لم يتم تفعيل النشاط الهدف.تحل هذه السمة محل أي إذن تم تعيينه للنشاط المستهدف نفسه. في حال حذف لم يتم تعيينه، فلا يلزم الحصول على إذن لتنشيط الهدف من خلال الاسم المستعار.
لمزيد من المعلومات حول الأذونات، يمكنك الاطّلاع على الأذونات في نظرة عامة على بيان التطبيق.
android:targetActivity
- اسم النشاط الذي يمكن تفعيله من خلال العنوان البديل للبريد الإلكتروني
يجب أن يتطابق هذا الاسم مع سمة
name
عنصر<activity>
يسبق الاسم المستعار في البيان.
- تم تقديمها في:
- المستوى 1 من واجهة برمجة التطبيقات
- راجِع أيضًا:
<activity>
<activity-alias>
يخضع كل من المحتوى وعيّنات التعليمات البرمجية في هذه الصفحة للتراخيص الموضحّة في ترخيص استخدام المحتوى. إنّ Java وOpenJDK هما علامتان تجاريتان مسجَّلتان لشركة Oracle و/أو الشركات التابعة لها.
تاريخ التعديل الأخير: 2025-07-27 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","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 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# <activity-alias\u003e\n\nsyntax:\n:\n\n ```xml\n \u003cactivity-alias android:enabled=[\"true\" | \"false\"]\n android:exported=[\"true\" | \"false\"]\n android:icon=\"drawable resource\"\n android:label=\"string resource\"\n android:name=\"string\"\n android:permission=\"string\"\n android:targetActivity=\"string\" \u003e\n ...\n \u003c/activity-alias\u003e\n ```\n\ncontained in:\n: [\u003capplication\u003e](/guide/topics/manifest/application-element)\n\ncan contain:\n: [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)\n\n [\u003cmeta-data\u003e](/guide/topics/manifest/meta-data-element)\n\ndescription:\n: An alias for an activity, named by the `targetActivity`\n attribute. The target must be in the same application as the\n alias and declared before the alias in the manifest.\n\n\n The alias presents the target activity as an independent entity, and can have its own set of intent\n filters. They, rather than the\n intent filters on the target activity itself, determine which intents\n can activate the target through the alias and how the system\n treats the alias.\n\n For example, the intent filters on the alias might\n specify the [\"android.intent.action.MAIN\"](/reference/android/content/Intent#ACTION_MAIN)\n and [\"android.intent.category.LAUNCHER\"](/reference/android/content/Intent#CATEGORY_LAUNCHER)\" flags, causing it to\n be represented in the application launcher, even though none of the\n filters on the target activity itself set these flags.\n\n\n With the exception of `targetActivity`, `\u003cactivity-alias\u003e`\n attributes are a subset of [\u003cactivity\u003e](/guide/topics/manifest/activity-element) attributes.\n For attributes in the subset, none of the values set for the target carry over\n to the alias. However, for attributes not in the subset, the values set for\n the target activity also apply to the alias.\n\nattributes:\n:\n\n `android:enabled`\n : Whether the target activity can be instantiated by the system through\n this alias. `\"true\"` if it can be, and `\"false\"` if not.\n The default value is `\"true\"`.\n\n\n The [\u003capplication\u003e](/guide/topics/manifest/application-element) element has its own\n [enabled](/guide/topics/manifest/application-element#enabled) attribute that applies to all\n application components, including activity aliases. The\n `\u003capplication\u003e` and `\u003cactivity-alias\u003e`\n attributes must both be `\"true\"` for the system to be able to instantiate\n the target activity through the alias. If either is `\"false\"`, the alias\n doesn't work.\n\n `android:exported`\n : Whether the components of other applications can launch the target activity\n through this alias. `\"true\"` if they can, and `\"false\"` if not.\n If `\"false\"`, the target activity can be launched through the alias only by\n components of the same application as the alias or applications with the same user ID.\n\n\n The default value depends on whether the alias contains intent filters. The\n absence of any filters means that the activity can be invoked through the alias\n only by specifying the exact name of the alias. This implies that the alias\n is intended only for application-internal use, since others don't know its name.\n So, the default value is `\"false\"`.\n On the other hand, the presence of at least one filter implies that the alias\n is intended for external use, so the default value is `\"true\"`.\n\n `android:icon`\n : An icon for the target activity when presented to users through the alias.\n For more information, see the [\u003cactivity\u003e](/guide/topics/manifest/activity-element) element's\n [icon](/guide/topics/manifest/activity-element#icon) attribute.\n\n `android:label`\n : A user-readable label for the alias when presented to users through the alias.\n For more information, see the [\u003cactivity\u003e](/guide/topics/manifest/activity-element) element's\n [label](/guide/topics/manifest/activity-element#label) attribute.\n\n \u003cbr /\u003e\n\n `android:name`\n\n : A unique name for the alias. The name resembles a fully qualified class name. But, unlike the name of the target activity, the alias name is arbitrary. It doesn't refer to an actual class. \u003cbr /\u003e\n\n `android:permission`\n : The name of a permission that clients must have to launch the target activity\n or get it to do something using the alias. If a caller of\n [startActivity()](/reference/android/content/Context#startActivity(android.content.Intent)) or\n [startActivityForResult()](/reference/android/app/Activity#startActivityForResult(android.content.Intent, int))\n isn't granted the specified permission, the target activity isn't activated.\n\n This attribute supplants any permission set for the target activity itself. If\n it isn't set, a permission isn't needed to activate the target through the alias.\n\n\n For more information about permissions, see the\n [Permissions](/guide/topics/manifest/manifest-intro#perms)\n section in the app manifest overview.\n\n `android:targetActivity`\n : The name of the activity that can be activated through the alias.\n This name must match the `name` attribute of an\n [\u003cactivity\u003e](/guide/topics/manifest/activity-element) element that precedes\n the alias in the manifest.\n\n \u003cbr /\u003e\n\nintroduced in:\n: API level 1\n\nsee also:\n: [\u003cactivity\u003e](/guide/topics/manifest/activity-element)"]]