you may want to look at

http://groups.google.com/group/android-developers/browse_thread/thread/1c64cf65f87c9895/1d9464c96b91dbd8?show_docid=1d9464c96b91dbd8



On Jan 30, 8:20 pm, Brodsky <peter.brod...@gmail.com> wrote:
> Hi!  Does anyone know how to tell when the headset button is being
> pressed?  I'd like to support the usb headsets and possibly bluetooth
> headsets.  My app is a media player and ideally, I could register it
> somewhere so that if no app that uses the headset button has focus it
> button press would act as a play/pause command in my app. If the phone
> is ringing or a call is in progress, I'd like to be sensitive to that
> and let the button do what it normally does: pickup and hang up
> calls.  we've been trying to chase the button down using this:
>
> IntentFilter headsetFilter = new IntentFilter
> (Intent.ACTION_HEADSET_PLUG);
> headsetFilter.addAction
> ("android.intent.action.HEADSET_STATE_CHANGED");
> headsetFilter.addAction("android.bluetooth.intent.HEADSET_STATE");
> headsetFilter.addAction
> ("android.bluetooth.intent.HEADSET_STATE_CHANGED");
> headsetFilter.addAction
> ("android.bluetooth.intent.action.MODE_CHANGED");
> headsetFilter.addAction("android.intent.action.MODE_CHANGED");
>
> no luck as of yet.  Any help would be greatly appreciated!  Thanks!
--~--~---------~--~----~------------~-------~--~----~
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