MediaSessionCompat.QueueItem


public final class MediaSessionCompat.QueueItem implements Parcelable


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

Summary

Constants

static final Parcelable.Creator<MediaSessionCompat.QueueItem>
static final int

This id is reserved.

Public constructors

QueueItem(MediaDescriptionCompat description, long id)

Creates a new MediaSessionCompat.QueueItem.

Public methods

int
static MediaSessionCompat.QueueItem
fromQueueItem(Object queueItem)

Creates an instance from a framework android.media.session.MediaSession.QueueItem object.

static List<MediaSessionCompat.QueueItem>

Creates a list of QueueItem objects from a framework android.media.session.MediaSession.QueueItem object list.

MediaDescriptionCompat

Gets the description for this item.

long

Gets the queue id for this item.

Object

Gets the underlying android.media.session.MediaSession.QueueItem.

String
void
writeToParcel(Parcel dest, int flags)

Inherited Constants

From android.os.Parcelable
static final int
static final int

Constants

CREATOR

Added in 1.1.0
public static final Parcelable.Creator<MediaSessionCompat.QueueItemCREATOR

UNKNOWN_ID

Added in 1.1.0
public static final int UNKNOWN_ID = -1

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

Public constructors

QueueItem

Added in 1.1.0
public QueueItem(MediaDescriptionCompat description, long id)

Creates a new MediaSessionCompat.QueueItem.

Parameters
MediaDescriptionCompat description

The MediaDescriptionCompat for this item.

long id

An identifier for this item. It must be unique within the play queue and cannot be UNKNOWN_ID.

Public methods

describeContents

Added in 1.1.0
public int describeContents()

fromQueueItem

Added in 1.1.0
public static MediaSessionCompat.QueueItem fromQueueItem(Object queueItem)

Creates an instance from a framework android.media.session.MediaSession.QueueItem object.

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

Parameters
Object queueItem

A android.media.session.MediaSession.QueueItem object.

Returns
MediaSessionCompat.QueueItem

An equivalent QueueItem object, or null if none.

fromQueueItemList

Added in 1.1.0
public static List<MediaSessionCompat.QueueItemfromQueueItemList(List<Object> itemList)

Creates a list of QueueItem objects from a framework android.media.session.MediaSession.QueueItem object list.

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

Parameters
List<Object> itemList

A list of android.media.session.MediaSession.QueueItem objects.

Returns
List<MediaSessionCompat.QueueItem>

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

getDescription

Added in 1.1.0
public MediaDescriptionCompat getDescription()

Gets the description for this item.

getQueueId

Added in 1.1.0
public long getQueueId()

Gets the queue id for this item.

getQueueItem

Added in 1.1.0
public Object getQueueItem()

Gets the underlying android.media.session.MediaSession.QueueItem.

On builds before LOLLIPOP null is returned.

Returns
Object

The underlying android.media.session.MediaSession.QueueItem or null.

toString

public String toString()

writeToParcel

Added in 1.1.0
public void writeToParcel(Parcel dest, int flags)