MediaSession.CommandButton

public static final class MediaSession.CommandButton
extends Object implements VersionedParcelable

java.lang.Object
   ↳ androidx.media2.session.MediaSession.CommandButton


Button for a SessionCommand 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 MediaSession.CommandButton.Builder

Builder for MediaSession.CommandButton

Public methods

SessionCommand getCommand()

Gets the command associated with this button.

CharSequence getDisplayName()

Gets the display name of the button.

Bundle getExtras()

Gets extra information of the button.

int getIconResId()

Gets the resource id of the button in this package.

boolean isEnabled()

Returns whether it's enabled.

Inherited methods

Public methods

getCommand

public SessionCommand getCommand ()

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

Returns
SessionCommand command or null