Android APIs
public static final class

MediaSessionCompat.QueueItem

extends Object
implements Parcelable
java.lang.Object
   ↳ android.support.v4.media.session.MediaSessionCompat.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<MediaSessionCompat.QueueItem> CREATOR
Public Constructors
MediaSessionCompat.QueueItem(MediaDescriptionCompat description, long id)
Public Methods
int describeContents()
Describe the kinds of special objects contained in this Parcelable's marshalled representation.
MediaDescriptionCompat getDescription()
Get the description for this item.
long getQueueId()
Get the queue id for this item.
Object getQueueItem()
Get the underlying MediaSession.QueueItem.
static MediaSessionCompat.QueueItem obtain(Object queueItem)
Obtain a compat wrapper for an existing QueueItem.
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

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

Constant Value: -1 (0xffffffff)

Fields

public static final Creator<MediaSessionCompat.QueueItem> CREATOR

Public Constructors

public MediaSessionCompat.QueueItem (MediaDescriptionCompat description, long id)

Parameters
description The MediaDescriptionCompat 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 ()

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 MediaDescriptionCompat getDescription ()

Get the description for this item.

public long getQueueId ()

Get the queue id for this item.

public Object getQueueItem ()

Get the underlying MediaSession.QueueItem.

On builds before LOLLIPOP null is returned.

Returns

public static MediaSessionCompat.QueueItem obtain (Object queueItem)

Obtain a compat wrapper for an existing QueueItem.

Parameters
queueItem The MediaSession.QueueItem to wrap.
Returns
  • A compat wrapper for the provided item.

public String toString ()

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)

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.