public final class

PlaybackStateCompat.CustomAction

extends java.lang.Object

 java.lang.Object

↳androidx.media3.session.legacy.PlaybackStateCompat.CustomAction

Overview

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

Summary

Fields
public static final <any>CREATOR

Methods
public intdescribeContents()

public static PlaybackStateCompat.CustomActionfromCustomAction(java.lang.Object customActionObj)

Creates an instance from a framework object.

public java.lang.StringgetAction()

Returns the action of the PlaybackStateCompat.CustomAction.

public java.lang.ObjectgetCustomAction()

Gets the underlying framework object.

public BundlegetExtras()

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

public intgetIcon()

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

public java.lang.CharSequencegetName()

Returns the display name of this action.

public java.lang.StringtoString()

public voidwriteToParcel(Parcel dest, int flags)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Fields

public static final <any> CREATOR

Methods

public void writeToParcel(Parcel dest, int flags)

public int describeContents()

public static PlaybackStateCompat.CustomAction fromCustomAction(java.lang.Object customActionObj)

Creates an instance from a framework object.

This method is only supported on API 21+.

Parameters:

customActionObj: A object, or null if none.

Returns:

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

public java.lang.Object getCustomAction()

Gets the underlying framework object.

This method is only supported on API 21+.

Returns:

An equivalent object, or null if none.

public java.lang.String getAction()

Returns the action of the PlaybackStateCompat.CustomAction.

Returns:

The action of the PlaybackStateCompat.CustomAction.

public java.lang.CharSequence getName()

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

Returns:

The display name of this PlaybackStateCompat.CustomAction.

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 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:

Optional arguments for the PlaybackStateCompat.CustomAction.

public java.lang.String toString()