Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
607 views
in Technique[技术] by (71.8m points)

android - What is the integer value that gives a broadcast receiver highest priority?

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>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...