Language

PlaybackState.Builder.AddCustomAction Method

Definition

Overloads

Name Description
AddCustomAction(PlaybackState+CustomAction)

Add a custom action to the playback state.

AddCustomAction(String, String, Int32)

Add a custom action to the playback state.

AddCustomAction(PlaybackState+CustomAction)

Add a custom action to the playback state.

[Android.Runtime.Register("addCustomAction", "(Landroid/media/session/PlaybackState$CustomAction;)Landroid/media/session/PlaybackState$Builder;", "")]
public Android.Media.Session.PlaybackState.Builder AddCustomAction(Android.Media.Session.PlaybackState.CustomAction customAction);
[<Android.Runtime.Register("addCustomAction", "(Landroid/media/session/PlaybackState$CustomAction;)Landroid/media/session/PlaybackState$Builder;", "")>]
member this.AddCustomAction : Android.Media.Session.PlaybackState.CustomAction -> Android.Media.Session.PlaybackState.Builder

Parameters

customAction
PlaybackState.CustomAction

The custom action to add to the PlaybackState.

Returns

this

Attributes

Remarks

Add a custom action to the playback state. Actions can be used to expose additional functionality to MediaControllers beyond what is offered by the standard transport controls.

An example of an action would be to start a radio station based on the current item or to skip ahead by 30 seconds.

Android reference for android.media.session.PlaybackState.Builder.addCustomAction.

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

AddCustomAction(String, String, Int32)

Add a custom action to the playback state.

[Android.Runtime.Register("addCustomAction", "(Ljava/lang/String;Ljava/lang/String;I)Landroid/media/session/PlaybackState$Builder;", "")]
public Android.Media.Session.PlaybackState.Builder AddCustomAction(string action, string name, int icon);
[<Android.Runtime.Register("addCustomAction", "(Ljava/lang/String;Ljava/lang/String;I)Landroid/media/session/PlaybackState$Builder;", "")>]
member this.AddCustomAction : string * string * int -> Android.Media.Session.PlaybackState.Builder

Parameters

action
String

An identifier for this action. It can be sent back to the MediaSession through MediaController.TransportControls.sendCustomAction(String,Bundle).

name
String

The display name for the action. If text is shown with the action or used for accessibility, this is what should be used.

icon
Int32

The resource action of the icon that should be displayed for the action. The resource should be in the package of the MediaSession.

Returns

this

Attributes

Remarks

Add a custom action to the playback state. Actions can be used to expose additional functionality to MediaControllers beyond what is offered by the standard transport controls.

e.g. start a radio station based on the current item or skip ahead by 30 seconds.

Android reference for android.media.session.PlaybackState.Builder.addCustomAction.

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