PlaybackStateCompat.CustomAction

Added in 1.1.0
Deprecated in 1.8.0

public final class PlaybackStateCompat.CustomAction implements Parcelable


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

Summary

Nested types

This class is deprecated. Deprecated in Java

Constants

static final Parcelable.Creator<PlaybackStateCompat.CustomAction>

This field is deprecated. Deprecated in Java

Public methods

int

This method is deprecated. Deprecated in Java

static PlaybackStateCompat.CustomAction
fromCustomAction(Object customActionObj)

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

Object

This method is deprecated. Deprecated in Java

Bundle

This method is deprecated. Deprecated in Java

int

This method is deprecated. Deprecated in Java

CharSequence

This method is deprecated. Deprecated in Java

String

This method is deprecated. Deprecated in Java

void
writeToParcel(Parcel dest, int flags)

This method is deprecated. Deprecated in Java

Inherited Constants

From android.os.Parcelable
static final int

This field is deprecated. Deprecated in Java

static final int

This field is deprecated. Deprecated in Java

Constants

CREATOR

Added in 1.1.0
Deprecated in 1.8.0
public static final Parcelable.Creator<PlaybackStateCompat.CustomAction> CREATOR

Public methods

describeContents

Added in 1.1.0
Deprecated in 1.8.0
public int describeContents()

fromCustomAction

Added in 1.1.0
Deprecated in 1.8.0
public static PlaybackStateCompat.CustomAction fromCustomAction(Object customActionObj)

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

This method is only supported on API 21+.

Parameters
Object customActionObj

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
Deprecated in 1.8.0
public String getAction()

Returns the action of the CustomAction.

Returns
String

The action of the CustomAction.

getCustomAction

Added in 1.1.0
Deprecated in 1.8.0
public Object getCustomAction()

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

This method is only supported on API 21+.

Returns
Object

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

getExtras

Added in 1.1.0
Deprecated in 1.8.0
public Bundle getExtras()

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
Deprecated in 1.8.0
public int getIcon()

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
Deprecated in 1.8.0
public CharSequence getName()

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

Returns
CharSequence

The display name of this CustomAction.

toString

public String toString()

writeToParcel

Added in 1.1.0
Deprecated in 1.8.0
public void writeToParcel(Parcel dest, int flags)