admin管理员组

文章数量:1623784

 android:icon="drawable resource"android:label="string resource"android:priority="integer" >

. . .

android:priorityThe 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. The default value is 0. The value must be greater than -1000 and less than 1000.

1. 优先级的概念用于描述控件的 intent的filter的类型。 这个属性只对activity 和 receivers 是有意义的。html

2. 隐式调用activity的状况下: 若是多个activity 知足响应 的条件,   系统只会触发 priority 高的那个activity。java

3. 有序广播发出的状况下:若是多个receiver知足响应的条件,系统会优先触发prioriyt搞的那个receiver。android

4. priority 必须是整数,默认是0    范围是[-1000, 1000]web

本文标签: ActivityandroidPriority