Skip to content

Most visited

Recently visited

navigation

MediaDescription.Builder

public static class MediaDescription.Builder
extends Object

java.lang.Object
   ↳ android.media.MediaDescription.Builder


Builder for MediaDescription objects.

Summary

Public constructors

MediaDescription.Builder()

Creates an initially empty builder.

Public methods

MediaDescription build()
MediaDescription.Builder setDescription(CharSequence description)

Sets the description.

MediaDescription.Builder setExtras(Bundle extras)

Sets a bundle of extras.

MediaDescription.Builder setIconBitmap(Bitmap icon)

Sets the icon.

MediaDescription.Builder setIconUri(Uri iconUri)

Sets the icon uri.

MediaDescription.Builder setMediaId(String mediaId)

Sets the media id.

MediaDescription.Builder setMediaUri(Uri mediaUri)

Sets the media uri.

MediaDescription.Builder setSubtitle(CharSequence subtitle)

Sets the subtitle.

MediaDescription.Builder setTitle(CharSequence title)

Sets the title.

Inherited methods

From class java.lang.Object

Public constructors

MediaDescription.Builder

added in API level 21
MediaDescription.Builder ()

Creates an initially empty builder.

Public methods

build

added in API level 21
MediaDescription build ()

Returns
MediaDescription

setDescription

added in API level 21
MediaDescription.Builder setDescription (CharSequence description)

Sets the description.

Parameters
description CharSequence: A description suitable for display to the user or null.

Returns
MediaDescription.Builder this

setExtras

added in API level 21
MediaDescription.Builder setExtras (Bundle extras)

Sets a bundle of extras.

Parameters
extras Bundle: The extras to include with this description or null.

Returns
MediaDescription.Builder this

setIconBitmap

added in API level 21
MediaDescription.Builder setIconBitmap (Bitmap icon)

Sets the icon.

Parameters
icon Bitmap: A Bitmap icon suitable for display to the user or null.

Returns
MediaDescription.Builder this

setIconUri

added in API level 21
MediaDescription.Builder setIconUri (Uri iconUri)

Sets the icon uri.

Parameters
iconUri Uri: A Uri for an icon suitable for display to the user or null.

Returns
MediaDescription.Builder this

setMediaId

added in API level 21
MediaDescription.Builder setMediaId (String mediaId)

Sets the media id.

Parameters
mediaId String: The unique id for the item or null.

Returns
MediaDescription.Builder this

setMediaUri

added in API level 23
MediaDescription.Builder setMediaUri (Uri mediaUri)

Sets the media uri.

Parameters
mediaUri Uri: The content's Uri for the item or null.

Returns
MediaDescription.Builder this

setSubtitle

added in API level 21
MediaDescription.Builder setSubtitle (CharSequence subtitle)

Sets the subtitle.

Parameters
subtitle CharSequence: A subtitle suitable for display to the user or null.

Returns
MediaDescription.Builder this

setTitle

added in API level 21
MediaDescription.Builder setTitle (CharSequence title)

Sets the title.

Parameters
title CharSequence: A title suitable for display to the user or null.

Returns
MediaDescription.Builder this

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!

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 one-minute survey?
Help us improve Android tools and documentation.