Possible to set BroadcastReceiver priority programmatically?
Is it possible to set the priority attribute of a BroadcastReceiver programmatically or can it only be done in XML? Relevant documents include:
http://developer.android.com/reference/android/content/BroadcastReceiver.html
开发者_JS百科http://developer.android.com/reference/android/R.styleable.html
It doesn't seem so, but I don't fully understand the relationship of android.R.styleable to a given application and its activities...
You don't set priority on BroadcastReceiver
(or Activity
) objects, but instead on the IntentFilter
object(s) that cause these items to be started.
With that in mind, IntentFilter.setPriority()
is what you want to use.
精彩评论