added in version 22.1.0
belongs to Maven artifact com.android.support:support-media-compat:28.0.0-alpha1

MediaMetadataCompat.Builder

public static final class MediaMetadataCompat.Builder
extends Object

java.lang.Object
   ↳ android.support.v4.media.MediaMetadataCompat.Builder


Use to build MediaMetadata objects. The system defined metadata keys must use the appropriate data type.

Summary

Public constructors

MediaMetadataCompat.Builder()

Create an empty Builder.

MediaMetadataCompat.Builder(MediaMetadataCompat source)

Create a Builder using a MediaMetadataCompat instance to set the initial values.

Public methods

MediaMetadataCompat build()

Creates a MediaMetadataCompat instance with the specified fields.

MediaMetadataCompat.Builder putBitmap(String key, Bitmap value)

Put a Bitmap into the metadata.

MediaMetadataCompat.Builder putLong(String key, long value)

Put a long value into the metadata.

MediaMetadataCompat.Builder putRating(String key, RatingCompat value)

Put a RatingCompat into the metadata.

MediaMetadataCompat.Builder putString(String key, String value)

Put a String value into the metadata.

MediaMetadataCompat.Builder putText(String key, CharSequence value)

Put a CharSequence value into the metadata.

Inherited methods

From class java.lang.Object

Public constructors

MediaMetadataCompat.Builder

added in version 22.1.0
MediaMetadataCompat.Builder ()

Create an empty Builder. Any field that should be included in the MediaMetadataCompat must be added.

MediaMetadataCompat.Builder

added in version 22.1.0
MediaMetadataCompat.Builder (MediaMetadataCompat source)

Create a Builder using a MediaMetadataCompat instance to set the initial values. All fields in the source metadata will be included in the new metadata. Fields can be overwritten by adding the same key.

Public methods

build

added in version 22.1.0
MediaMetadataCompat build ()

Creates a MediaMetadataCompat instance with the specified fields.

Returns
MediaMetadataCompat The new MediaMetadata instance

putBitmap

added in version 22.1.0
MediaMetadataCompat.Builder putBitmap (String key,
                Bitmap value)

Put a Bitmap into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Large bitmaps may be scaled down when setMetadata(MediaMetadataCompat) is called. To pass full resolution images Uris should be used with putString(String, String).

Parameters
key String: The key for referencing this value

value Bitmap: The Bitmap to store

Returns
MediaMetadataCompat.Builder The Builder to allow chaining

putLong

added in version 22.1.0
MediaMetadataCompat.Builder putLong (String key,
                long value)

Put a long value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key String: The key for referencing this value

value long: The String value to store

Returns
MediaMetadataCompat.Builder The Builder to allow chaining

putRating

added in version 22.1.0
MediaMetadataCompat.Builder putRating (String key,
                RatingCompat value)

Put a RatingCompat into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key String: The key for referencing this value

value RatingCompat: The String value to store

Returns
MediaMetadataCompat.Builder The Builder to allow chaining

putString

added in version 22.1.0
MediaMetadataCompat.Builder putString (String key,
                String value)

Put a String value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key String: The key for referencing this value

value String: The String value to store

Returns
MediaMetadataCompat.Builder The Builder to allow chaining

putText

added in version 22.1.0
MediaMetadataCompat.Builder putText (String key,
                CharSequence value)

Put a CharSequence value into the metadata. Custom keys may be used, but if the METADATA_KEYs defined in this class are used they may only be one of the following:

Parameters
key String: The key for referencing this value

value CharSequence: The CharSequence value to store

Returns
MediaMetadataCompat.Builder The Builder to allow chaining