<intent-filter>

syntax:
<intent-filter android:icon="drawable resource"
               android:label="string resource"
               android:priority="integer" >
    . . .
</intent-filter>
contained in:
<activity>
<activity-alias>
<service>
<receiver>
must contain:
<action>
can contain:
<category>
<data>
description:
Specifies the types of intents that an activity, service, or broadcast receiver can respond to. An intent filter declares the capabilities of its parent component what an activity or service can do and what types of broadcasts a receiver can handle. It opens the component to receiving intents of the advertised type, while filtering out those that are not meaningful for the component.

Most of the contents of the filter are described by its <action>, <category>, and <data> subelements.

For a more detailed discussion of filters, see the separate Intents and Intent Filters document, as well as the Intents Filters section in the introduction.

액티비티, 서비스, 또는 브로드캐스트 리시버가 응답할 수 있는 인텐트의 타입을 명시한다. 인텐트 필터는 그것의 부모parent 컴포넌트의 기능을 선언한다 ? 액티비티 또는 서비스가 할 수 있는 것이 무엇인지, 그리고 브로드캐스트 리시버가 처리할 수 있는 타입이 무엇인지. 그것은 컴포넌트에 무의미한 인텐트들을 필터링함으로써, 공시된 타입의 인텐트를 수신하도록 컴포넌트를 개방한다.

필터의 대부분의 컨텐트는 그것의 <action>, <category>, 그리고 <data> 서브엘리먼트에 의해 기술된다.

필터의 더 상세한 논의에 대해서는, 앞에 나왔던 인텐트 필터 섹션과 5장. “인텐트와 인텐트 필터”를 보라.

attributes:
android:icon
An icon that represents the parent activity, service, or broadcast receiver when that component is presented to the user as having the capability described by the filter.

This attribute must be set as a reference to a drawable resource containing the image definition. The default value is the icon set by the parent component's icon attribute. If the parent does not specify an icon, the default is the icon set by the <application> element.

For more on intent filter icons, see Icons and Labels in the introduction.

그 컴포넌트가 필터에 의해 기술된 기능을 가지는 것과 같이 사용자에게 표시될 때, 그것의 부모 액티비티, 서비스, 또는 브로드캐스트 리시버를 표시하는 아이콘.

이 애트리뷰트는 이미지 정의를 포함하는 드로어블drawable 리소스에 대한 레퍼런스로써 설정되어야 한다. 디폴트 값은 부모 컴포넌트의 icon 애트리뷰트에 의해 설정된 아이콘이다. 만약 부모가 icon 설정하지 않는다면, 디폴트는 <application> 엘리먼트에 의해 설정된 아이콘이다.

인텐트 필터 아이콘에 대한 보다 많은 것에 대해서는, 앞에 나왔던 아이콘과 라벨을 보라.

android:label
A user-readable label for the parent component. This label, rather than the one set by the parent component, is used when the component is presented to the user as having the capability described by the filter.

The label should be set as a reference to a string resource, so that it can be localized like other strings in the user interface. However, as a convenience while you're developing the application, it can also be set as a raw string.

The default value is the label set by the parent component. If the parent does not specify a label, the default is the label set by the <application> element's label attribute.

For more on intent filter labels, see Icons and Labels in the introduction.

부모 컴포넌트에 대한 사용자가 읽을 수 있는 라벨. 이 라벨은 부모 컴포넌트에 의해 설정된 것보다는 컴포넌트가 필터에 의해 기술된 기능을 가지는 것과 같이 사용자에게 보여질 때 사용되어진다.

라벨은 사용자 인터페이스의 다른 문자열과 같이 로컬라이즈 될 수 있도록, 문자열 리소스에 대한 참조로써 설정되어야만 한다. 하지만 여러분이 애플리케이션을 개발하는 동안 편리하도록, 그것은 또한 원시 문자열로써 설정될 수 있다.

디폴트 값은 부모 컴포넌트에 의해 설정된 라벨이다. 만약 부모가 라벨을 설정하지 않으면, 디폴트는 <application> 엘리먼트의 label 애트리뷰트에 의해 설정된 라벨이다.

인텐트 필터 라벨에 관한 더 많은 것에 대해서는, 앞에 나왔던 아이콘과 라벨을 보라.

android:priority
The priority that should be given to the parent component with regard to handling intents of the type described by the filter. This attribute has meaning for both activities and broadcast receivers:
  • It provides information about how able an activity is to respond to an intent that matches the filter, relative to other activities that could also respond to the intent. When an intent could be handled by multiple activities with different priorities, Android will consider only those with higher priority values as potential targets for the intent.
  • It controls the order in which broadcast receivers are executed to receive broadcast messages. Those with higher priority values are called before those with lower values. (The order applies only to synchronous messages; it's ignored for asynchronous messages.)

Use this attribute only if you really need to impose a specific order in which the broadcasts are received, or want to force Android to prefer one activity over others.

The value must be an integer, such as "100". Higher numbers have a higher priority.

필터에 의해 기술된 타입의 인텐트를 처리하는 것에 대해 부모 컴포넌트에게 주어져야만 하는 우선순위priority. 이 애트리뷰트는 액티비티와 브로드캐스트 리시버에 의미가 있다.
  • 그것은 필터와 일치하는 인텐트에 대해, 그 인텐트에 또한 응답할 수 있는 다른 액티비티들과 비교하여 임의의 액티비티가 응답할 수 있는 방법에 대한 정보를 제공한다. 인텐트가 서로 다른 우선순위를 가지는 여러 액티비티에 의해 처리될 수 있을 때, 안드로이드는 인텐트에 대한 잠재적 타겟으로써 더 높은 우선순위 값을 가지는 액티비티만을 고려할 것이다.
  • 그것은 브로드캐스트 메시지를 수신하기 위해 실행되는 브로드캐스트 리시버의 순서를 제어한다. 더 높은 우선순위 값을 가지는 것이 더 낮은 값을 갖는 것보다 먼저 호출된다(순서는 동기적 메시지들에게만 적용된다; 그것은 비동기적 메시지에 대해서는 무시된다).

만약 여러분이 정말로 브로드캐스트를 특정 순서대로 수신하도록 하는 것이 필요하거나, 또는 안드로이드가 다른 것들 보다 특정 액티비티를 선호하도록 강제하고 싶으면 이 애트리뷰트를 사용하라.

값은 “100”와 같은 정수integer이어야 한다. 더 높은 숫자는 더 높은 우선순위를 가진다.

introduced in:
API Level 1
see also:
<action>
<category>
<data>
↑ Go to top