<action>
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
- składnia:
<action android:name="string" />
- zawarte w:
<intent-filter>
- description:
- Dodaje działanie do filtra intencji.
<intent-filter>
element musi zawierać co najmniej jeden element <action>
. Jeśli
nie zawierają elementów <action>
w filtrze intencji,
nie akceptuje żadnych obiektów Intent
.
Szczegółowe informacje o filtrach intencji i roli działania
specyfikacji w filtrze, zobacz
Intencje
Filtry intencji.
- atrybuty:
android:name
- Nazwa działania. Niektóre działania standardowe są zdefiniowane w sekcji
Intent
zajęcia jako
stałe ACTION_string
. Aby przypisać jedno z tych działań użytkownikowi
tego atrybutu, dołącz android.intent.action.
na początku
string
, który pasuje do: ACTION_
.
Na przykład w polu ACTION_MAIN
użyj android.intent.action.MAIN
,
a w przypadku ACTION_WEB_SEARCH
– android.intent.action.WEB_SEARCH
.
W przypadku działań zdefiniowanych przez Ciebie najlepiej użyć nazwy pakietu aplikacji jako prefiksu
pomagają w zapewnieniu unikatowości. Na przykład można określić działanie TRANSMOGRIFY
w następujący sposób:
<action android:name="com.example.project.TRANSMOGRIFY" />
- wprowadzone w:
- Poziom API 1
- zobacz też:
<intent-filter>
Treść strony i umieszczone na niej fragmenty kodu podlegają licencjom opisanym w Licencji na treści. Java i OpenJDK są znakami towarowymi lub zastrzeżonymi znakami towarowymi należącymi do firmy Oracle lub jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-27 UTC.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 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)"]]