androidaudioheadphones

wired headphones plugged in and out


I need an event executing when user plugs in/out wired headphones, it made in HTC sense player.

android.media.AudioManager doesn't generate an event, it even doesn't return a correct value with isWiredHeadsetOn()

How can I know if wired headset plugged or not?


Solution

  • Try ACTION_HEADSET_PLUG.