MediaSessionCompat.QueueItem


class MediaSessionCompat.QueueItem : 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

const Parcelable.Creator<MediaSessionCompat.QueueItem!>!
const Int

This id is reserved.

Public constructors

QueueItem(description: MediaDescriptionCompat!, id: Long)

Creates a new MediaSessionCompat.QueueItem.

Public functions

Int
java-static MediaSessionCompat.QueueItem!
fromQueueItem(queueItem: Any!)

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

java-static (Mutable)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.

Any!

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

String!
Unit
writeToParcel(dest: Parcel!, flags: Int)

Constants

CREATOR

Added in 1.1.0
const val CREATORParcelable.Creator<MediaSessionCompat.QueueItem!>!

UNKNOWN_ID

Added in 1.1.0
const val UNKNOWN_ID = -1: Int

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

Public constructors

QueueItem

Added in 1.1.0
QueueItem(description: MediaDescriptionCompat!, id: Long)

Creates a new MediaSessionCompat.QueueItem.

Parameters
description: MediaDescriptionCompat!

The MediaDescriptionCompat for this item.

id: Long

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

Public functions

describeContents

Added in 1.1.0
fun describeContents(): Int

fromQueueItem

Added in 1.1.0
java-static fun fromQueueItem(queueItem: Any!): MediaSessionCompat.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
queueItem: Any!

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

Returns
MediaSessionCompat.QueueItem!

An equivalent QueueItem object, or null if none.

fromQueueItemList

Added in 1.1.0
java-static fun fromQueueItemList(itemList: (Mutable)List<Any!>!): (Mutable)List<MediaSessionCompat.QueueItem!>!

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
itemList: (Mutable)List<Any!>!

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

Returns
(Mutable)List<MediaSessionCompat.QueueItem!>!

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

getDescription

Added in 1.1.0
fun getDescription(): MediaDescriptionCompat!

Gets the description for this item.

getQueueId

Added in 1.1.0
fun getQueueId(): Long

Gets the queue id for this item.

getQueueItem

Added in 1.1.0
fun getQueueItem(): Any!

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

On builds before LOLLIPOP null is returned.

Returns
Any!

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

toString

fun toString(): String!

writeToParcel

Added in 1.1.0
fun writeToParcel(dest: Parcel!, flags: Int): Unit