AudioManager.RegisterMediaButtonEventReceiver Method

Definition

Overloads

RegisterMediaButtonEventReceiver(PendingIntent)
Obsolete.

Register a component to be the sole receiver of MEDIA_BUTTON intents.

RegisterMediaButtonEventReceiver(ComponentName)
Obsolete.

Register a component to be the sole receiver of MEDIA_BUTTON intents.

RegisterMediaButtonEventReceiver(PendingIntent)

Caution

deprecated

Register a component to be the sole receiver of MEDIA_BUTTON intents.

[Android.Runtime.Register("registerMediaButtonEventReceiver", "(Landroid/app/PendingIntent;)V", "GetRegisterMediaButtonEventReceiver_Landroid_app_PendingIntent_Handler")]
[System.Obsolete("deprecated")]
public virtual void RegisterMediaButtonEventReceiver (Android.App.PendingIntent? eventReceiver);
[<Android.Runtime.Register("registerMediaButtonEventReceiver", "(Landroid/app/PendingIntent;)V", "GetRegisterMediaButtonEventReceiver_Landroid_app_PendingIntent_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member RegisterMediaButtonEventReceiver : Android.App.PendingIntent -> unit
override this.RegisterMediaButtonEventReceiver : Android.App.PendingIntent -> unit

Parameters

eventReceiver
PendingIntent

target that will receive media button intents. The PendingIntent will be sent an Intent#ACTION_MEDIA_BUTTON event when a media button action occurs, with Intent#EXTRA_KEY_EVENT added and holding the key code of the media button that was pressed.

Attributes

Remarks

Register a component to be the sole receiver of MEDIA_BUTTON intents. This is like #registerMediaButtonEventReceiver(android.content.ComponentName), but allows the buttons to go to any PendingIntent. Note that you should only use this form if you know you will continue running for the full time until unregistering the PendingIntent.

This member is deprecated. Use MediaSession#setMediaButtonReceiver(PendingIntent) instead.

Java documentation for android.media.AudioManager.registerMediaButtonEventReceiver(android.app.PendingIntent).

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

RegisterMediaButtonEventReceiver(ComponentName)

Caution

deprecated

Register a component to be the sole receiver of MEDIA_BUTTON intents.

[Android.Runtime.Register("registerMediaButtonEventReceiver", "(Landroid/content/ComponentName;)V", "GetRegisterMediaButtonEventReceiver_Landroid_content_ComponentName_Handler")]
[System.Obsolete("deprecated")]
public virtual void RegisterMediaButtonEventReceiver (Android.Content.ComponentName? eventReceiver);
[<Android.Runtime.Register("registerMediaButtonEventReceiver", "(Landroid/content/ComponentName;)V", "GetRegisterMediaButtonEventReceiver_Landroid_content_ComponentName_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member RegisterMediaButtonEventReceiver : Android.Content.ComponentName -> unit
override this.RegisterMediaButtonEventReceiver : Android.Content.ComponentName -> unit

Parameters

eventReceiver
ComponentName

identifier of a android.content.BroadcastReceiver that will receive the media button intent. This broadcast receiver must be declared in the application manifest. The package of the component must match that of the context you're registering from.

Attributes

Remarks

Register a component to be the sole receiver of MEDIA_BUTTON intents.

This member is deprecated. Use MediaSession#setMediaButtonReceiver(PendingIntent) instead.

Java documentation for android.media.AudioManager.registerMediaButtonEventReceiver(android.content.ComponentName).

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