Android APIs
public static final class

PlaybackStateCompat.CustomAction

extends Object
implements Parcelable
java.lang.Object
   ↳ android.support.v4.media.session.PlaybackStateCompat.CustomAction

Class Overview

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

Summary

Nested Classes
class PlaybackStateCompat.CustomAction.Builder Builder for PlaybackStateCompat.CustomAction objects. 
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<PlaybackStateCompat.CustomAction> CREATOR
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
static PlaybackStateCompat.CustomAction fromCustomAction(Object customActionObj)
Creates an instance from a framework PlaybackState.CustomAction object.
String getAction()
Returns the action of the PlaybackStateCompat.CustomAction.
Object getCustomAction()
Gets the underlying framework PlaybackState.CustomAction object.
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 Session'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<PlaybackStateCompat.CustomAction> CREATOR

Public Methods

public int describeContents ()

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 static PlaybackStateCompat.CustomAction fromCustomAction (Object customActionObj)

Creates an instance from a framework PlaybackState.CustomAction object.

This method is only supported on API 21+.

Parameters
customActionObj A PlaybackState.CustomAction object, or null if none.
Returns

public String getAction ()

Returns the action of the PlaybackStateCompat.CustomAction.

Returns

public Object getCustomAction ()

Gets the underlying framework PlaybackState.CustomAction object.

This method is only supported on API 21+.

Returns

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

public int getIcon ()

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

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

public CharSequence getName ()

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

Returns

public String toString ()

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)

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.