public final class

PlaybackStateCompat.CustomAction.Builder

extends java.lang.Object

 java.lang.Object

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

Overview

Builder for PlaybackStateCompat.CustomAction objects.

Summary

Constructors
publicBuilder(java.lang.String action, java.lang.CharSequence name, int icon)

Creates a PlaybackStateCompat.CustomAction builder with the id, name, and icon set.

Methods
public PlaybackStateCompat.CustomActionbuild()

Build and return the PlaybackStateCompat.CustomAction instance with the specified values.

public PlaybackStateCompat.CustomAction.BuildersetExtras(Bundle extras)

Set optional extras for the PlaybackStateCompat.CustomAction.

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

Constructors

public Builder(java.lang.String action, java.lang.CharSequence name, int icon)

Creates a PlaybackStateCompat.CustomAction builder with the id, name, and icon set.

Parameters:

action: The action of the PlaybackStateCompat.CustomAction.
name: The display name of the PlaybackStateCompat.CustomAction. This name will be displayed along side the action if the UI supports it.
icon: The icon resource id of the PlaybackStateCompat.CustomAction. This resource id must be in the same package as the MediaSessionCompat. It will be displayed with the custom action if the UI supports it.

Methods

public PlaybackStateCompat.CustomAction.Builder setExtras(Bundle extras)

Set optional extras for the PlaybackStateCompat.CustomAction. These extras are meant to be consumed by a MediaControllerCompat if it knows how to handle them. Keys should be fully qualified (e.g. "com.example.MY_ARG") to avoid collisions.

Parameters:

extras: Optional extras for the PlaybackStateCompat.CustomAction.

Returns:

this.

Build and return the PlaybackStateCompat.CustomAction instance with the specified values.

Returns:

A new PlaybackStateCompat.CustomAction instance.