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 |
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
|
getDisplayName
public CharSequence getDisplayName ()
Gets the display name of the button. Can be null
or empty if the command is
predefined and custom name isn't needed.
Returns | |
---|---|
CharSequence |
custom display name. Can be null or empty.
|
getExtras
public Bundle getExtras ()
Gets extra information of the button. It's private information between session and controller.
Returns | |
---|---|
Bundle |
getIconResId
public int getIconResId ()
Gets the 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
public boolean isEnabled ()
Returns whether it's enabled.
Returns | |
---|---|
boolean |
true if enabled. false otherwise.
|
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-30 UTC.