Android APIs
public static final class

MediaSession.QueueItem

extends Object
implements Parcelable
java.lang.Object
   ↳ android.media.session.MediaSession.QueueItem

Class 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

Constants
int UNKNOWN_ID This id is reserved.
[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<MediaSession.QueueItem> CREATOR
Public Constructors
MediaSession.QueueItem(MediaDescription description, long id)
Create a new MediaSession.QueueItem.
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
MediaDescription getDescription()
Get the description for this item.
long getQueueId()
Get the queue id for this item.
String toString()
Returns a string containing a concise, human-readable description of this object.
void writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Constants

public static final int UNKNOWN_ID

Added in API level 21

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

Constant Value: -1 (0xffffffff)

Fields

public static final Creator<MediaSession.QueueItem> CREATOR

Added in API level 21

Public Constructors

public MediaSession.QueueItem (MediaDescription description, long id)

Added in API level 21
Parameters
description The MediaDescription for this item.
id An identifier for this item. It must be unique within the play queue and cannot be UNKNOWN_ID.

Public Methods

public int describeContents ()

Added in API level 21

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Returns
  • a bitmask indicating the set of special object types marshalled by the Parcelable.

public MediaDescription getDescription ()

Added in API level 21

Get the description for this item.

public long getQueueId ()

Added in API level 21

Get the queue id for this item.

public String toString ()

Added in API level 21

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
  • a printable representation of this object.

public void writeToParcel (Parcel dest, int flags)

Added in API level 21

Flatten this object in to a Parcel.

Parameters
dest The Parcel in which the object should be written.
flags Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.