public final class

MediaSessionCompat.QueueItem

extends java.lang.Object

 java.lang.Object

↳androidx.media3.session.legacy.MediaSessionCompat.QueueItem

Overview

A single item that is part of the play queue. It contains a description of the item and its id in the queue.

Summary

Fields
public static final <any>CREATOR

public static final intUNKNOWN_ID

This id is reserved.

Constructors
publicQueueItem(MediaDescriptionCompat description, long id)

Creates a new MediaSessionCompat.QueueItem.

Methods
public intdescribeContents()

public static MediaSessionCompat.QueueItemfromQueueItem(java.lang.Object queueItem)

Creates an instance from a framework object.

public static java.util.List<MediaSessionCompat.QueueItem>fromQueueItemList(java.util.List<java.lang.Object> itemList)

Creates a list of MediaSessionCompat.QueueItem objects from a framework object list.

public MediaDescriptionCompatgetDescription()

Gets the description for this item.

public longgetQueueId()

Gets the queue id for this item.

public java.lang.ObjectgetQueueItem()

Gets the underlying .

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 int UNKNOWN_ID

This id is reserved. No items can be explicitly assigned this id.

public static final <any> CREATOR

Constructors

public QueueItem(MediaDescriptionCompat description, long id)

Creates a new MediaSessionCompat.QueueItem.

Parameters:

description: The MediaDescriptionCompat for this item.
id: An identifier for this item. It must be unique within the play queue and cannot be MediaSessionCompat.QueueItem.UNKNOWN_ID.

Methods

public MediaDescriptionCompat getDescription()

Gets the description for this item.

public long getQueueId()

Gets the queue id for this item.

public void writeToParcel(Parcel dest, int flags)

public int describeContents()

public java.lang.Object getQueueItem()

Gets the underlying .

On builds before null is returned.

Returns:

The underlying or null.

public static MediaSessionCompat.QueueItem fromQueueItem(java.lang.Object queueItem)

Creates an instance from a framework object.

This method is only supported on API 21+.

Parameters:

queueItem: A object.

Returns:

An equivalent MediaSessionCompat.QueueItem object.

public static java.util.List<MediaSessionCompat.QueueItem> fromQueueItemList(java.util.List<java.lang.Object> itemList)

Creates a list of MediaSessionCompat.QueueItem objects from a framework object list.

This method is only supported on API 21+. On API 20 and below, it returns null.

Parameters:

itemList: A list of objects.

Returns:

An equivalent list of MediaSessionCompat.QueueItem objects, or null if none.

public java.lang.String toString()