(original) (raw)

syntax:

<action android:name="_string_" />

contained in:

[<intent-filter>](/guide/topics/manifest/intent-filter-element)

description:

Adds an action to an intent filter. An [<intent-filter>](/guide/topics/manifest/intent-filter-element)element must contain one or more <action> elements. If there are no <action> elements in an intent filter, the filter doesn't accept any [Intent](/reference/android/content/Intent) objects. For details about intent filters and the role of action specifications within a filter, seeIntents and Intent Filters.

attributes:

android:name

The name of the action. Some standard actions are defined in the[Intent](/reference/android/content/Intent#ACTION%5FCHOOSER) class asACTION_ _string_ constants. To assign one of these actions to this attribute, prepend android.intent.action. to the_string_ that follows ACTION_. For example, for ACTION_MAIN, use android.intent.action.MAIN, and for ACTION_WEB_SEARCH, use android.intent.action.WEB_SEARCH.

For actions you define, it's best to use your app's package name as a prefix to help ensure uniqueness. For example, a TRANSMOGRIFY action might be specified as follows:

introduced in:

API Level 1

see also:

[<intent-filter>](/guide/topics/manifest/intent-filter-element)

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.