<action>

syntax:
<action android:name="string" />
contained in:
<intent-filter>

description:
Adds an action to an intent filter. An <intent-filter> element must contain one or more <action> elements. If it doesn't contain any, no Intent objects will get through the filter. See Intents and Intent Filters for details on intent filters and the role of action specifications within a filter.
인텐트 필터에 액션을 추가한다. <intent-filter> 엘리먼트는 하나 또는 그 이상의 <action> 엘리먼트를 포함해야 한다. 만약 그것이 아무 것도 포함하지 않는다면, 어떤 인텐트 오브젝트도 필터를 통해 얻어지지 않을 것이다. 인텐트 필터와 필터 내부의 액션 명세의 역할에 대한 상세 내용에 대해서는 5장. “인텐트와 인텐트 필터”를 보라.
attributes:
android:name
The name of the action. Some standard actions are defined in the Intent class as ACTION_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 the package name as a prefix to ensure uniqueness. For example, a TRANSMOGRIFY action might be specified as follows:

<action android:name="com.example.project.TRANSMOGRIFY" />
android:name
액션의 이름. 어떤 표준 액션들은 ACTION_문자열 상수로써 인텐트 클래스에서 정의된다. 이 애트리뷰트에 이러한 액션 중 하나를 할당하기 위해서는, ACTION_ 뒤에 나오는 문자열 앞에 “android.intent.action.”을 추가하라. 예를 들어 ACTION_MAIN에 대해서는, “android.intent.action.MAIN”를 사용하고, ACTION_WEB_SEARCH에 대해서는, “android.intent.action.WEB_SEARCH를 사용하라.

여러분이 정의하는 액션에 대해, 유일함을 보장하기 위해 접두어로 패키지 이름을 사용하는 것이 최선이다. 예를 들어 TRANSMOGRIFY 액션은 다음과 같이 지정될 수 있다.:

<action android:name="com.example.project.TRANSMOGRIFY" />
introduced in:
API Level 1
see also:
<intent-filter>
↑ Go to top