17

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

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...

Box Box Box Box
  • 5,094
  • 10
  • 49
  • 67
ChaimKut
  • 2,759
  • 3
  • 38
  • 64

1 Answers1

40

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.

Christopher Orr
  • 110,418
  • 27
  • 198
  • 193