PlaybackStateCompat.CustomAction

class PlaybackStateCompat.CustomAction : Parcelable


CustomActions can be used to extend the capabilities of the standard transport controls by exposing app specific actions to Controllers.

Summary

Nested types

Builder for CustomAction objects.

Public functions

Int
java-static PlaybackStateCompat.CustomAction!
fromCustomAction(customActionObj: Any!)

Creates an instance from a framework android.media.session.PlaybackState.CustomAction object.

String!

Returns the action of the CustomAction.

Any!

Gets the underlying framework android.media.session.PlaybackState.CustomAction object.

Bundle!

Returns extras which provide additional application-specific information about the action, or null if none.

Int

Returns the resource id of the icon in the Session's package.

CharSequence!

Returns the display name of this action. e.g. "Favorite"

String!
Unit
writeToParcel(dest: Parcel!, flags: Int)

Constants

Public functions

describeContents

Added in 1.1.0
fun describeContents(): Int

fromCustomAction

Added in 1.1.0
java-static fun fromCustomAction(customActionObj: Any!): PlaybackStateCompat.CustomAction!

Creates an instance from a framework android.media.session.PlaybackState.CustomAction object.

This method is only supported on API 21+.

Parameters
customActionObj: Any!

A android.media.session.PlaybackState.CustomAction object, or null if none.

Returns
PlaybackStateCompat.CustomAction!

An equivalent PlaybackStateCompat.CustomAction object, or null if none.

getAction

Added in 1.1.0
fun getAction(): String!

Returns the action of the CustomAction.

Returns
String!

The action of the CustomAction.

getCustomAction

Added in 1.1.0
fun getCustomAction(): Any!

Gets the underlying framework android.media.session.PlaybackState.CustomAction object.

This method is only supported on API 21+.

Returns
Any!

An equivalent android.media.session.PlaybackState.CustomAction object, or null if none.

getExtras

Added in 1.1.0
fun getExtras(): Bundle!

Returns extras which provide additional application-specific information about the action, or null if none. These arguments are meant to be consumed by a MediaControllerCompat if it knows how to handle them.

Returns
Bundle!

Optional arguments for the CustomAction.

getIcon

Added in 1.1.0
fun getIcon(): Int

Returns the resource id of the icon in the Session's package.

Returns
Int

The resource id of the icon in the Session's package.

getName

Added in 1.1.0
fun getName(): CharSequence!

Returns the display name of this action. e.g. "Favorite"

Returns
CharSequence!

The display name of this CustomAction.

toString

fun toString(): String!

writeToParcel

Added in 1.1.0
fun writeToParcel(dest: Parcel!, flags: Int): Unit