I notice that the music app does not release 'sole ownership' of the intent even once it's UI exits, so anything in the background that previously wanted to pick it up is out of luck. Which I did want to do, as it happens.
Also that the previous owner doesn't have to release for another app to be able to grab ownership. Lee On May 25, 2:41 am, Stefan <[email protected]> wrote: > I am trying to figure out what is the correct (new) approach for > handling of Intent.ACTION_MEDIA_BUTTON in Froyo. In pre 2.2 days we > had to register a BroadcastReceiver (either permanently or at run- > time) and the Media Button events would arrive (as long as no other > application intercepts them and aborts the broadcast). > > Froyo seems to still somewhat support that model (at least for the > wired headset), but it also introduces the > registerMediaButtonEventReceiver, and > unregisterMediaButtonEventReceiver methods that seem to control the > "transport focus" between applications. > > During my experiments, using registerMediaButtonEventReceiver does > cause both the bluetooth and the wired headset button presses to be > routed to the application's broadcast receiver (the app gets the > "transport focus"), but it looks like any change in the audio routing > (for example unplugging the headset) shits the focus back to the > default media player. > > What is the correct way to handle that in Froyo? Do we have to detect > the change in the audio routing and try to re-gain the focus? > > This is an issue that any 3rd party media player on the Android > platform has to deal with, so I hope that a Google Engineer can > provide some guidelines that we all can follow. Having a standard > approach may make headset button controls a bit more predictable for > the end users. > > Stefan > > -- > 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 > athttp://groups.google.com/group/android-developers?hl=en -- 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

