Android APIs
public static final class

PlaybackState.CustomAction

extends Object
implements Parcelable
java.lang.Object
   ↳ android.media.session.PlaybackState.CustomAction

Class Overview

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

Summary

Nested Classes
class PlaybackState.CustomAction.Builder Builder for PlaybackState.CustomAction objects. 
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<PlaybackState.CustomAction> CREATOR
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
String getAction()
Returns the action of the PlaybackState.CustomAction.
Bundle getExtras()
Returns extras which provide additional application-specific information about the action, or null if none.
int getIcon()
Returns the resource id of the icon in the MediaSession's package.
CharSequence getName()
Returns the display name of this action.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<PlaybackState.CustomAction> CREATOR

Added in API level 21

Public Methods

public int describeContents ()

Added in API level 21

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public String getAction ()

Added in API level 21

Returns the action of the PlaybackState.CustomAction.

Returns

public Bundle getExtras ()

Added in API level 21

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

Returns

public int getIcon ()

Added in API level 21

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

Returns

public CharSequence getName ()

Added in API level 21

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

Returns

public String toString ()

Added in API level 21

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 21

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.