Android official documentation: (2) Application List -- 2.11 & lt; intent-filter & gt; tag

Source: Internet
Author: User

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 broadcastreceiver can respond. an intent filter declares the capabilities of itsparent component-what an activity or service can do and what types of broadcasts a receiver er can handle. it opens the component to inform ing 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.

Attributes:
android:icon
An icon that represents the parent activity, service, or broadcastreceiver 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'siconAttribute. If the parent does not specify an icon, the default is the icon set by<application>Element.

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

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

The label shoshould be set as a reference to a string resource, so thatit 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<application>Element's labelAttribute.

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

android:priority
The priority that shocould be given to the parent component with regardto 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 couldalso respond to the intent. when an intent cocould be handled by multiple activities with different priorities, Android will consider only those withhigher priority values as potential targets for the intent.
  • It controls the order in which broadcast receivers are executed toreceive 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 stored ed, or want to force Android to preferone activity over others.

The value must be an integer, such"100". Higher numbers have ahigher priority. The default value is 0.The value must be greater than-1000 and less than 1000.

Also seesetPriority().

Introduced in:
API Level 1
See also:
<action>
<category>
<data>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.