什么是整数值,给出了一个广播接收机优先级最高的 [英] What is the integer value that gives a broadcast receiver highest priority
问题描述
什么是整数值给出一个广播接收器的最高优先级
<意图过滤器的Android版本:优先级=1>
<作用机器人:名称=android.provider.Telephony.SMS_RECEIVED/>
&所述; /意图滤光器>
那么,根据<一href="http://developer.android.com/guide/topics/manifest/intent-filter-element.html">documentation
的值必须为整数,如100,数值越大,有更高的优先级。
所以,我猜测任何整数值是有效的。与最高优先级的可能将是最大整数机器人允许,其为(2 ^ 31 - 1)。
修改
该文档已被更新,现在明确规定其优先级值可以使用的应用程序。文档现在说
SYSTEM_HIGH_PRIORITY(1000):应用程序不应该使用的过滤器 与此或更高的优先级。 SYSTEM_LOW_PRIORITY(-1000):应用程序不应该使用的过滤器 与此或更低的优先级。
难不成您的应用程序允许使用-999和999之间的整数的优先级。
what is the integer value the gives a broadcast receiver the highest priority
<intent-filter android:priority="1">
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
Well, according to the documentation
"The value must be an integer, such as "100". Higher numbers have a higher priority."
So I'm guessing that any integer value is valid. And the highest priority possible would be the maximum integer that android allows, which is (2^31 - 1).
EDIT
The documentation has been updated, and it now explicitly states which priority values may be used by applications. The documentation now says
SYSTEM_HIGH_PRIORITY (1000): Applications should never use filters with this or higher priorities. SYSTEM_LOW_PRIORITY (-1000): Applications should never use filters with this or lower priorities.
Implying that your application is permitted to use integer priority levels between -999 and 999.
这篇关于什么是整数值,给出了一个广播接收机优先级最高的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!