- نحو:
<action android:name="string" />
- موجود در:
-
<intent-filter>
- توضیحات:
- یک عمل را به فیلتر قصد اضافه می کند. یک عنصر
<intent-filter>
باید دارای یک یا چند عنصر<action>
باشد. اگر هیچ عنصر<action>
در فیلتر intent وجود نداشته باشد، فیلتر هیچ شیءIntent
را نمی پذیرد. برای جزئیات بیشتر درباره فیلترهای هدف و نقش مشخصات عملکرد در یک فیلتر، به Intent و Intent Filters مراجعه کنید. - صفات:
-
android:name
- نام عمل. برخی از اقدامات استاندارد در کلاس
Intent
به عنوان ثابت هایACTION_ string
تعریف می شوند. برای تخصیص یکی از این اکشن ها به این ویژگی،android.intent.action.
بهstring
کهACTION_
دنبال می کند. برای مثال، برایACTION_MAIN
، ازandroid.intent.action.MAIN
، و برایACTION_WEB_SEARCH
، ازandroid.intent.action.WEB_SEARCH
استفاده کنید.برای اقداماتی که تعریف می کنید، بهتر است از نام بسته برنامه خود به عنوان پیشوند استفاده کنید تا از منحصر به فرد بودن اطمینان حاصل شود. به عنوان مثال، یک عمل
TRANSMOGRIFY
ممکن است به صورت زیر مشخص شود:<action android:name="com.example.project.TRANSMOGRIFY" />
-
- معرفی شده در:
- API سطح 1
- همچنین ببینید:
-
<intent-filter>
<عمل>
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# <action\u003e\n\nsyntax:\n:\n\n ```xml\n \u003caction android:name=\"string\" /\u003e\n ```\n\ncontained in:\n: [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)\n\ndescription:\n: Adds an action to an intent filter.\n An [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)\n element must contain one or more `\u003caction\u003e` elements. If there\n are no `\u003caction\u003e` elements in an intent filter, the filter\n doesn't accept any [Intent](/reference/android/content/Intent) objects.\n For details about intent filters and the role of action\n specifications within a filter, see\n [Intents and\n Intent Filters](/guide/components/intents-filters).\n\nattributes:\n:\n\n `android:name`\n : The name of the action. Some standard actions are defined in the\n [Intent](/reference/android/content/Intent#ACTION_CHOOSER) class as\n `ACTION_`*string* constants. To assign one of these actions to\n this attribute, prepend `android.intent.action.` to the\n *string* that follows `ACTION_`.\n For example, for `ACTION_MAIN`, use `android.intent.action.MAIN`,\n and for `ACTION_WEB_SEARCH`, use `android.intent.action.WEB_SEARCH`.\n\n\n For actions you define, it's best to use your app's package name as a prefix to\n help ensure uniqueness. For example, a `TRANSMOGRIFY` action might be specified\n as follows:\n\n\n ```xml\n \u003caction android:name=\"com.example.project.TRANSMOGRIFY\" /\u003e\n ```\n\nintroduced in:\n: API Level 1\n\nsee also:\n: [\u003cintent-filter\u003e](/guide/topics/manifest/intent-filter-element)"]]