belongs to Maven artifact androidx.media:media:1.0.0-alpha1

MediaSession2.CommandButton

public static final class MediaSession2.CommandButton
extends Object

java.lang.Object
   ↳ androidx.media.MediaSession2.CommandButton


Button for a SessionCommand2 that will be shown by the controller.

It's up to the controller's decision to respect or ignore this customization request.

Summary

Nested classes

class MediaSession2.CommandButton.Builder

Builder for MediaSession2.CommandButton

Public methods

SessionCommand2 getCommand()

Get command associated with this button.

String getDisplayName()

Display name of the button.

Bundle getExtras()

Extra information of the button.

int getIconResId()

Resource id of the button in this package.

boolean isEnabled()

Return whether it's enabled.

Inherited methods

Public methods

getCommand

SessionCommand2 getCommand ()

Get command associated with this button. Can be null if the button isn't enabled and only providing placeholder.

Returns
SessionCommand2 command or null

getDisplayName

String getDisplayName ()

Display name of the button. Can be null or empty if the command is predefined and custom name isn't needed.

Returns
String custom display name. Can be null or empty.

getExtras

Bundle getExtras ()

Extra information of the button. It's private information between session and controller.

Returns
Bundle

getIconResId

int getIconResId ()

Resource id of the button in this package. Can be 0 if the command is predefined and custom icon isn't needed.

Returns
int resource id of the icon. Can be 0.

isEnabled

boolean isEnabled ()

Return whether it's enabled.

Returns
boolean true if enabled. false otherwise.