Android APIs
public static final class

MediaMetadataCompat.Builder

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

Class Overview

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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MediaMetadataCompat.Builder ()

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

public 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

public MediaMetadataCompat build ()

Creates a MediaMetadataCompat instance with the specified fields.

Returns
  • The new MediaMetadata instance

public 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:

Parameters
key The key for referencing this value
value The Bitmap to store
Returns
  • The Builder to allow chaining

public 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 The key for referencing this value
value The String value to store
Returns
  • The Builder to allow chaining

public 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 The key for referencing this value
value The String value to store
Returns
  • The Builder to allow chaining

public MediaMetadataCompat.Builder putString (String key, String value)

Parameters
key The key for referencing this value
value The String value to store
Returns
  • The Builder to allow chaining

public MediaMetadataCompat.Builder putText (String key, CharSequence value)

Parameters
key The key for referencing this value
value The CharSequence value to store
Returns
  • The Builder to allow chaining