Register now for Android Dev Summit 2019!

QueueItem

class QueueItem : Parcelable
kotlin.Any
   ↳ android.support.v4.media.session.MediaSessionCompat.QueueItem

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 Int

This id is reserved.

Public constructors

<init>(description: MediaDescriptionCompat!, id: Long)

Creates a new MediaSessionCompat.QueueItem.

Public methods

Int

static MediaSessionCompat.QueueItem!
fromQueueItem(queueItem: Any!)

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

static MutableList<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)

Properties

static Creator<MediaSessionCompat.QueueItem!>!

Constants

UNKNOWN_ID

static val UNKNOWN_ID: Int

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

Value: -1

Public constructors

<init>

QueueItem(description: MediaDescriptionCompat!, id: Long)

Creates a new MediaSessionCompat.QueueItem.

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

Public methods

describeContents

fun describeContents(): Int

fromQueueItem

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.
Return
MediaSessionCompat.QueueItem!: An equivalent QueueItem object, or null if none.

fromQueueItemList

static fun fromQueueItemList(itemList: MutableList<*>!): MutableList<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 MutableList<*>!: A list of android.media.session.MediaSession.QueueItem objects.
Return
MutableList<MediaSessionCompat.QueueItem!>!: An equivalent list of QueueItem objects, or null if none.

getDescription

fun getDescription(): MediaDescriptionCompat!

Gets the description for this item.

getQueueId

fun getQueueId(): Long

Gets the queue id for this item.

getQueueItem

fun getQueueItem(): Any!

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

On builds before android.os.Build.VERSION_CODES#LOLLIPOP null is returned.

Return
Any!: The underlying android.media.session.MediaSession.QueueItem or null.

toString

fun toString(): String

writeToParcel

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

Properties

CREATOR

static val CREATOR: Creator<MediaSessionCompat.QueueItem!>!