On Fri, Jul 23, 2010 at 9:19 PM, Jin Chiu <[email protected]> wrote: > The documentation for sendOrderedBroadcast() describes the function as > following: > "Broadcast the given intent to all interested BroadcastReceivers, > delivering them one at a time to allow more preferred receivers to > consume the broadcast before it is delivered to less preferred > receivers." > > How do we specify which receiver is preferred, such that the preferred > receiver gets the first shot at handling the intent?
Receivers set their priority in the manifest: http://developer.android.com/guide/topics/manifest/intent-filter-element.html > To illustrate, say I have 2 possible activities, ActivityA and > ActivityB, to handle them intent. If both are alive, I would like > ActivityA to always handle the intent in favor of ActivityB. sendOrderedBroadcast() is for ordered broadcasts, not activity Intents (e.g., startActivity()). -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.9 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

