lightbulb_outline Please take our October 2018 developer survey. Start survey
added in version 22.1.0
belongs to Maven artifact androidx.media:media:1.0.0

MediaDescriptionCompat

public final class MediaDescriptionCompat
extends Object implements Parcelable

java.lang.Object
   ↳ android.support.v4.media.MediaDescriptionCompat


A simple set of metadata for a media item suitable for display. This can be created using the Builder or retrieved from existing metadata using MediaMetadataCompat.getDescription().

Summary

Nested classes

class MediaDescriptionCompat.Builder

Builder for MediaDescriptionCompat objects. 

Constants

long BT_FOLDER_TYPE_ALBUMS

The type of folder that contains folders categorized by album as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_ARTISTS

The type of folder that contains folders categorized by artist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_GENRES

The type of folder that contains folders categorized by genre as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_MIXED

The type of folder that is unknown or contains media elements of mixed types as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_PLAYLISTS

The type of folder that contains folders categorized by playlist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_TITLES

The type of folder that contains media elements only as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

long BT_FOLDER_TYPE_YEARS

The type of folder that contains folders categorized by year as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

String EXTRA_BT_FOLDER_TYPE

Used as a long extra field to indicate the bluetooth folder type of the media item as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

String EXTRA_DOWNLOAD_STATUS

Used as a long extra field to indicate the download status of the media item.

long STATUS_DOWNLOADED

The status value to indicate the media item is downloaded for later offline playback.

long STATUS_DOWNLOADING

The status value to indicate the media item is being downloaded.

long STATUS_NOT_DOWNLOADED

The status value to indicate the media item is not downloaded.

Inherited constants

Fields

public static final Creator<MediaDescriptionCompat> CREATOR

Public methods

int describeContents()
static MediaDescriptionCompat fromMediaDescription(Object descriptionObj)

Creates an instance from a framework MediaDescription object.

CharSequence getDescription()

Returns a description suitable for display or null.

Bundle getExtras()

Returns any extras that were added to the description.

Bitmap getIconBitmap()

Returns a bitmap icon suitable for display or null.

Uri getIconUri()

Returns a Uri for an icon suitable for display or null.

Object getMediaDescription()

Gets the underlying framework MediaDescription object.

String getMediaId()

Returns the media id or null.

Uri getMediaUri()

Returns a Uri representing this content or null.

CharSequence getSubtitle()

Returns a subtitle suitable for display or null.

CharSequence getTitle()

Returns a title suitable for display or null.

String toString()
void writeToParcel(Parcel dest, int flags)

Inherited methods

Constants

BT_FOLDER_TYPE_ALBUMS

public static final long BT_FOLDER_TYPE_ALBUMS

The type of folder that contains folders categorized by album as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 2 (0x0000000000000002)

BT_FOLDER_TYPE_ARTISTS

public static final long BT_FOLDER_TYPE_ARTISTS

The type of folder that contains folders categorized by artist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 3 (0x0000000000000003)

BT_FOLDER_TYPE_GENRES

public static final long BT_FOLDER_TYPE_GENRES

The type of folder that contains folders categorized by genre as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 4 (0x0000000000000004)

BT_FOLDER_TYPE_MIXED

public static final long BT_FOLDER_TYPE_MIXED

The type of folder that is unknown or contains media elements of mixed types as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 0 (0x0000000000000000)

BT_FOLDER_TYPE_PLAYLISTS

public static final long BT_FOLDER_TYPE_PLAYLISTS

The type of folder that contains folders categorized by playlist as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 5 (0x0000000000000005)

BT_FOLDER_TYPE_TITLES

public static final long BT_FOLDER_TYPE_TITLES

The type of folder that contains media elements only as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 1 (0x0000000000000001)

BT_FOLDER_TYPE_YEARS

public static final long BT_FOLDER_TYPE_YEARS

The type of folder that contains folders categorized by year as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5.

Constant Value: 6 (0x0000000000000006)

EXTRA_BT_FOLDER_TYPE

public static final String EXTRA_BT_FOLDER_TYPE

Used as a long extra field to indicate the bluetooth folder type of the media item as specified in the section 6.10.2.2 of the Bluetooth AVRCP 1.5. This is valid only for MediaBrowserCompat.MediaItem with MediaBrowserCompat.MediaItem.FLAG_BROWSABLE. The value should be one of the following:

See also:

Constant Value: "android.media.extra.BT_FOLDER_TYPE"

EXTRA_DOWNLOAD_STATUS

added in version 26.1.0
public static final String EXTRA_DOWNLOAD_STATUS

Used as a long extra field to indicate the download status of the media item. The value should be one of the following:

See also:

Constant Value: "android.media.extra.DOWNLOAD_STATUS"

STATUS_DOWNLOADED

added in version 26.1.0
public static final long STATUS_DOWNLOADED

The status value to indicate the media item is downloaded for later offline playback.

Constant Value: 2 (0x0000000000000002)

STATUS_DOWNLOADING

added in version 26.1.0
public static final long STATUS_DOWNLOADING

The status value to indicate the media item is being downloaded.

Constant Value: 1 (0x0000000000000001)

STATUS_NOT_DOWNLOADED

added in version 26.1.0
public static final long STATUS_NOT_DOWNLOADED

The status value to indicate the media item is not downloaded.

Constant Value: 0 (0x0000000000000000)

Fields

CREATOR

added in version 22.1.0
public static final Creator<MediaDescriptionCompat> CREATOR

Public methods

describeContents

added in version 22.1.0
public int describeContents ()

Returns
int

fromMediaDescription

added in version 22.1.0
public static MediaDescriptionCompat fromMediaDescription (Object descriptionObj)

Creates an instance from a framework MediaDescription object.

This method is only supported on API 21+.

Parameters
descriptionObj Object: A MediaDescription object, or null if none.

Returns
MediaDescriptionCompat An equivalent MediaMetadataCompat object, or null if none.

getDescription

added in version 22.1.0
public CharSequence getDescription ()

Returns a description suitable for display or null.

Returns
CharSequence A description or null.

getExtras

added in version 22.1.0
public Bundle getExtras ()

Returns any extras that were added to the description.

Returns
Bundle A bundle of extras or null.

getIconBitmap

added in version 22.1.0
public Bitmap getIconBitmap ()

Returns a bitmap icon suitable for display or null.

Returns
Bitmap An icon or null.

getIconUri

added in version 22.1.0
public Uri getIconUri ()

Returns a Uri for an icon suitable for display or null.

Returns
Uri An icon uri or null.

getMediaDescription

added in version 22.1.0
public Object getMediaDescription ()

Gets the underlying framework MediaDescription object.

This method is only supported on Build.VERSION_CODES.LOLLIPOP and later.

Returns
Object An equivalent MediaDescription object, or null if none.

getMediaId

added in version 22.1.0
public String getMediaId ()

Returns the media id or null. See MediaMetadataCompat.METADATA_KEY_MEDIA_ID.

Returns
String

getMediaUri

public Uri getMediaUri ()

Returns a Uri representing this content or null.

Returns
Uri A media Uri or null.

getSubtitle

added in version 22.1.0
public CharSequence getSubtitle ()

Returns a subtitle suitable for display or null.

Returns
CharSequence A subtitle or null.

getTitle

added in version 22.1.0
public CharSequence getTitle ()

Returns a title suitable for display or null.

Returns
CharSequence A title or null.

toString

public String toString ()

Returns
String

writeToParcel

added in version 22.1.0
public void writeToParcel (Parcel dest, 
                int flags)

Parameters
dest Parcel

flags int