AudioManager.ActionHeadsetPlug Field

Definition

Broadcast Action: Wired Headset plugged in or unplugged.

[Android.Runtime.Register("ACTION_HEADSET_PLUG")]
public const string ActionHeadsetPlug;
[<Android.Runtime.Register("ACTION_HEADSET_PLUG")>]
val mutable ActionHeadsetPlug : string

Field Value

Attributes

Remarks

Broadcast Action: Wired Headset plugged in or unplugged.

You <em>cannot</em> receive this through components declared in manifests, only by explicitly registering for it with Context#registerReceiver(BroadcastReceiver, IntentFilter) Context.registerReceiver().

The intent will have the following extra values: <ul> <li><em>state</em> - 0 for unplugged, 1 for plugged. </li> <li><em>name</em> - Headset type, human readable string </li> <li><em>microphone</em> - 1 if headset has a microphone, 0 otherwise </li> </ul> </ul>

Java documentation for android.media.AudioManager.ACTION_HEADSET_PLUG.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to