<action>
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
- תחביר:
<action android:name="string" />
- בתוך:
<intent-filter>
- תיאור:
- מוסיף פעולה למסנן Intent.
<intent-filter>
חייב להכיל רכיב אחד או יותר מסוג <action>
. אם יש
אין רכיבי <action>
במסנן Intent, המסנן
לא מקבל אובייקטים של Intent
.
פרטים על מסנני Intent ותפקיד הפעולה
המפרטים של מסנן כלשהו:
כוונות וכן
מסנני Intent
- :
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>
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],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)"]]