Skip to content

Most visited

Recently visited

navigation
added in version 22.1.0
belongs to Maven artifact com.android.support:support-media-compat:27.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 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

From interface android.os.Parcelable

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

From class java.lang.Object
From interface android.os.Parcelable

Constants

BT_FOLDER_TYPE_ALBUMS

added in version 25.1.0
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

added in version 25.1.0
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

added in version 25.1.0
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

added in version 25.1.0
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

added in version 25.1.0
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

added in version 25.1.0
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

added in version 25.1.0
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

added in version 25.1.0
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 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
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
long STATUS_DOWNLOADED

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

See also:

Constant Value: 2 (0x0000000000000002)

STATUS_DOWNLOADING

added in version 26.1.0
long STATUS_DOWNLOADING

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

See also:

Constant Value: 1 (0x0000000000000001)

STATUS_NOT_DOWNLOADED

added in version 26.1.0
long STATUS_NOT_DOWNLOADED

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

See also:

Constant Value: 0 (0x0000000000000000)

Fields

CREATOR

added in version 22.1.0
Creator<MediaDescriptionCompat> CREATOR

Public methods

describeContents

added in version 22.1.0
int describeContents ()

Returns
int

fromMediaDescription

added in version 22.1.0
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
CharSequence getDescription ()

Returns a description suitable for display or null.

Returns
CharSequence A description or null.

getExtras

added in version 22.1.0
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
Bitmap getIconBitmap ()

Returns a bitmap icon suitable for display or null.

Returns
Bitmap An icon or null.

getIconUri

added in version 22.1.0
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
Object getMediaDescription ()

Gets the underlying framework MediaDescription object.

This method is only supported on LOLLIPOP and later.

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

getMediaId

added in version 22.1.0
String getMediaId ()

Returns the media id or null. See METADATA_KEY_MEDIA_ID.

Returns
String

getMediaUri

added in version 24.1.0
Uri getMediaUri ()

Returns a Uri representing this content or null.

Returns
Uri A media Uri or null.

getSubtitle

added in version 22.1.0
CharSequence getSubtitle ()

Returns a subtitle suitable for display or null.

Returns
CharSequence A subtitle or null.

getTitle

added in version 22.1.0
CharSequence getTitle ()

Returns a title suitable for display or null.

Returns
CharSequence A title or null.

toString

String toString ()

Returns
String

writeToParcel

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

Parameters
dest Parcel

flags int

This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Follow Google Developers on WeChat

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience. (Dec 2017 Android Platform & Tools Survey)