Added in API level 21

QueueItem


class QueueItem : Parcelable
kotlin.Any
   ↳ android.media.session.MediaSession.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.

Inherited constants
Public constructors
QueueItem(description: MediaDescription!, id: Long)

Create a new MediaSession.QueueItem.

Public methods
Int

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

Boolean
equals(other: Any?)

Indicates whether some other object is "equal to" this one.

MediaDescription!

Get the description for this item.

Long

Get the queue id for this item.

String

Returns a string representation of the object.

Unit
writeToParcel(dest: Parcel, flags: Int)

Flatten this object in to a Parcel.

Properties
static Parcelable.Creator<MediaSession.QueueItem!>

Constants

UNKNOWN_ID

Added in API level 21
static val UNKNOWN_ID: Int

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

Value: -1

Public constructors

QueueItem

Added in API level 21
QueueItem(
    description: MediaDescription!,
    id: Long)

Create a new MediaSession.QueueItem.

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

Public methods

describeContents

Added in API level 21
fun describeContents(): Int

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int), the return value of this method must include the CONTENTS_FILE_DESCRIPTOR bit.

Return
Int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.
Value is either 0 or

equals

Added in API level 21
fun equals(other: Any?): Boolean

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getDescription

Added in API level 21
fun getDescription(): MediaDescription!

Get the description for this item.

getQueueId

Added in API level 21
fun getQueueId(): Long

Get the queue id for this item.

toString

Added in API level 21
fun toString(): String

Returns a string representation of the object.

Return
String a string representation of the object.

writeToParcel

Added in API level 21
fun writeToParcel(
    dest: Parcel,
    flags: Int
): Unit

Flatten this object in to a Parcel.

Parameters
dest Parcel: The Parcel in which the object should be written.
This value cannot be null.
flags Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.
Value is either 0 or a combination of the following:

Properties

CREATOR

Added in API level 21
static val CREATOR: Parcelable.Creator<MediaSession.QueueItem!>