The Android Developer Challenge is back! Submit your idea before December 2.

Builder

class Builder
kotlin.Any
   ↳ 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

Create an empty Builder.

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

Public methods

MediaMetadataCompat!

Creates a MediaMetadataCompat instance with the specified fields.

MediaMetadataCompat.Builder!
putBitmap(key: String!, value: Bitmap!)

Put a Bitmap into the metadata.

MediaMetadataCompat.Builder!
putLong(key: String!, value: Long)

Put a long value into the metadata.

MediaMetadataCompat.Builder!
putRating(key: String!, value: RatingCompat!)

Put a RatingCompat into the metadata.

MediaMetadataCompat.Builder!
putString(key: String!, value: String!)

Put a String value into the metadata.

MediaMetadataCompat.Builder!
putText(key: String!, value: CharSequence!)

Put a CharSequence value into the metadata.

Public constructors

<init>

Builder()

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

<init>

Builder(source: MediaMetadataCompat!)

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.

Parameters
source MediaMetadataCompat!:

Public methods

build

fun build(): MediaMetadataCompat!

Creates a MediaMetadataCompat instance with the specified fields.

Return
MediaMetadataCompat!: The new MediaMetadata instance

putBitmap

fun putBitmap(key: String!, value: Bitmap!): MediaMetadataCompat.Builder!

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 android.support.v4.media.session.MediaSessionCompat#setMetadata is called. To pass full resolution images Uris should be used with putString.

Parameters
key String!: The key for referencing this value
value String!: The Bitmap to store
Return
MediaMetadataCompat.Builder!: The Builder to allow chaining

putLong

fun putLong(key: String!, value: Long): MediaMetadataCompat.Builder!

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 String!: The String value to store
Return
MediaMetadataCompat.Builder!: The Builder to allow chaining

putRating

fun putRating(key: String!, value: RatingCompat!): MediaMetadataCompat.Builder!

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 String!: The String value to store
Return
MediaMetadataCompat.Builder!: The Builder to allow chaining

putString

fun putString(key: String!, value: String!): MediaMetadataCompat.Builder!

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
Return
MediaMetadataCompat.Builder!: The Builder to allow chaining

putText

fun putText(key: String!, value: CharSequence!): MediaMetadataCompat.Builder!

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 String!: The CharSequence value to store
Return
MediaMetadataCompat.Builder!: The Builder to allow chaining