Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

Builder

class Builder : BuilderBase<MediaLibraryService.MediaLibrarySession!, MediaLibraryService.MediaLibrarySession.Builder!, MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback!>
androidx.media2.session.MediaLibraryService.MediaLibrarySession.Builder

Builder for MediaLibrarySession.

Any incoming event from the MediaController will be handled on the callback executor. If it's not set, ContextCompat#getMainExecutor(Context) will be used by default.

Summary

Public constructors

<init>(@NonNull service: MediaLibraryService, @NonNull player: SessionPlayer, @NonNull callbackExecutor: Executor, @NonNull callback: MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback)

Public methods

MediaLibraryService.MediaLibrarySession

MediaLibraryService.MediaLibrarySession.Builder
setExtras(@NonNull extras: Bundle)

MediaLibraryService.MediaLibrarySession.Builder
setId(@NonNull id: String)

MediaLibraryService.MediaLibrarySession.Builder

Public constructors

<init>

Builder(@NonNull service: MediaLibraryService, @NonNull player: SessionPlayer, @NonNull callbackExecutor: Executor, @NonNull callback: MediaLibraryService.MediaLibrarySession.MediaLibrarySessionCallback)

Public methods

build

@NonNull fun build(): MediaLibraryService.MediaLibrarySession

setExtras

@NonNull fun setExtras(@NonNull extras: Bundle): MediaLibraryService.MediaLibrarySession.Builder

setId

@NonNull fun setId(@NonNull id: String): MediaLibraryService.MediaLibrarySession.Builder

setSessionActivity

@NonNull fun setSessionActivity(@Nullable pi: PendingIntent?): MediaLibraryService.MediaLibrarySession.Builder