public static final class MediaSession.CommandButton
extends Object implements VersionedParcelable

   ↳ 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.


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


public SessionCommand getCommand ()

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

SessionCommand command or null