CustomAction

class CustomAction : Parcelable
kotlin.Any
   ↳ android.support.v4.media.session.PlaybackStateCompat.CustomAction

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

Summary

Nested classes

Builder for CustomAction objects.

Public methods
Int

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

CharSequence!

Returns the display name of this action.

String

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.

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

String!

Returns the action of the CustomAction.

Int

static PlaybackStateCompat.CustomAction!
fromCustomAction(customActionObj: Any!)

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

Properties
static Creator<PlaybackStateCompat.CustomAction!>!

Public methods

getIcon

fun getIcon(): Int

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

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

getName

fun getName(): CharSequence!

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

Return
CharSequence!: The display name of this CustomAction.

toString

fun toString(): String

getCustomAction

fun getCustomAction(): Any!

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

This method is only supported on API 21+.

Return
Any!: An equivalent android.media.session.PlaybackState.CustomAction object, or null if none.

getExtras

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.

Return
Bundle!: Optional arguments for the CustomAction.

writeToParcel

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

getAction

fun getAction(): String!

Returns the action of the CustomAction.

Return
String!: The action of the CustomAction.

describeContents

fun describeContents(): Int

fromCustomAction

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.
Return
PlaybackStateCompat.CustomAction!: An equivalent PlaybackStateCompat.CustomAction object, or null if none.

Properties

CREATOR

static val CREATOR: Creator<PlaybackStateCompat.CustomAction!>!