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 |
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
|
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 |
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:
BT_FOLDER_TYPE_MIXED
BT_FOLDER_TYPE_TITLES
BT_FOLDER_TYPE_ALBUMS
BT_FOLDER_TYPE_ARTISTS
BT_FOLDER_TYPE_GENRES
BT_FOLDER_TYPE_PLAYLISTS
BT_FOLDER_TYPE_YEARS
See also:
Constant Value: "android.media.extra.BT_FOLDER_TYPE"
EXTRA_DOWNLOAD_STATUS
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
public static final 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
public static final long STATUS_DOWNLOADING
The status value to indicate the media item is being downloaded.
See also:
Constant Value: 1 (0x0000000000000001)
STATUS_NOT_DOWNLOADED
public static final long STATUS_NOT_DOWNLOADED
The status value to indicate the media item is not downloaded.
See also:
Constant Value: 0 (0x0000000000000000)
Fields
Public methods
fromMediaDescription
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
public CharSequence getDescription ()
Returns a description suitable for display or null.
Returns | |
---|---|
CharSequence |
A description or null. |
getExtras
public Bundle getExtras ()
Returns any extras that were added to the description.
Returns | |
---|---|
Bundle |
A bundle of extras or null. |
getIconBitmap
public Bitmap getIconBitmap ()
Returns a bitmap icon suitable for display or null.
Returns | |
---|---|
Bitmap |
An icon or null. |
getIconUri
public Uri getIconUri ()
Returns a Uri for an icon suitable for display or null.
Returns | |
---|---|
Uri |
An icon uri or null. |
getMediaDescription
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
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
public CharSequence getSubtitle ()
Returns a subtitle suitable for display or null.
Returns | |
---|---|
CharSequence |
A subtitle or null. |
getTitle
public CharSequence getTitle ()
Returns a title suitable for display or null.
Returns | |
---|---|
CharSequence |
A title or null. |
toString
public String toString ()
Returns | |
---|---|
String |
writeToParcel
public void writeToParcel (Parcel dest, int flags)
Parameters | |
---|---|
dest |
Parcel |
flags |
int |
Classes
- MediaBrowserCompat
- MediaBrowserCompat.ConnectionCallback
- MediaBrowserCompat.CustomActionCallback
- MediaBrowserCompat.ItemCallback
- MediaBrowserCompat.MediaItem
- MediaBrowserCompat.SearchCallback
- MediaBrowserCompat.SubscriptionCallback
- MediaDescriptionCompat
- MediaDescriptionCompat.Builder
- MediaMetadataCompat
- MediaMetadataCompat.Builder
- RatingCompat
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-09-30 UTC.