I'm writing music app, and find a confusing issue about headset
buttons.
My app has a BroadcastReceiver class to receive headset button
controls, with

<action android:name="android.intent.action.MEDIA_BUTTON"/>

as intent filter.

The problem is, when I unplug a wired headset slowly, sometimes
Android will broadcast MEDIA_BUTTON intents with
KeyEvent.KEYCODE_HEADSETHOOK. It equals to a normal play/pause button
pressing, so my app starts playing automatically.
But the default Music app does not come up, and I can't find anything
checking or preventing this in the Android source code.
Anyone have idea about how to avoid this? Thank you very much!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to