ACTION_HEADSET_PLUG constant

String const ACTION_HEADSET_PLUG

Broadcast Action: Wired Headset plugged in or unplugged.

You cannot receive this through components declared in manifests, only by explicitly registering for it with {@link Context#registerReceiver(BroadcastReceiver, IntentFilter) Context.registerReceiver()}.

The intent will have the following extra values:

  • state - 0 for unplugged, 1 for plugged.
  • name - Headset type, human readable string
  • microphone - 1 if headset has a microphone, 0 otherwise

Implementation

static const String ACTION_HEADSET_PLUG =
    "android.intent.action.HEADSET_PLUG";