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

BrowserCallback

open class BrowserCallback : MediaController.ControllerCallback
kotlin.Any
   ↳ androidx.media2.session.MediaController.ControllerCallback
   ↳ androidx.media2.session.MediaBrowser.BrowserCallback

Callback to listen events from MediaLibraryService.

Summary

Public constructors

Callback to listen events from MediaLibraryService.

Public methods

open Unit
onChildrenChanged(@NonNull browser: MediaBrowser, @NonNull parentId: String, itemCount: Int, @Nullable params: MediaLibraryService.LibraryParams?)

Called when there's change in the parent's children after you've subscribed to the parent with subscribe.

open Unit
onSearchResultChanged(@NonNull browser: MediaBrowser, @NonNull query: String, itemCount: Int, @Nullable params: MediaLibraryService.LibraryParams?)

Called when there's change in the search result requested by the previous MediaBrowser#search(String, LibraryParams).

Inherited functions

Public constructors

<init>

BrowserCallback()

Callback to listen events from MediaLibraryService.

Public methods

onChildrenChanged

open fun onChildrenChanged(@NonNull browser: MediaBrowser, @NonNull parentId: String, itemCount: Int, @Nullable params: MediaLibraryService.LibraryParams?): Unit

Called when there's change in the parent's children after you've subscribed to the parent with subscribe.

This API is called when the library service called MediaLibraryService.MediaLibrarySession#notifyChildrenChanged for the parent.

Parameters
browser MediaBrowser: the browser for this event
parentId MediaBrowser: non-empty parent id that you've specified with subscribe(String, LibraryParams)
itemCount MediaBrowser: number of children
params MediaBrowser: library params from the library service. Can be differ from params that you've specified with subscribe(String, LibraryParams).

onSearchResultChanged

open fun onSearchResultChanged(@NonNull browser: MediaBrowser, @NonNull query: String, itemCount: Int, @Nullable params: MediaLibraryService.LibraryParams?): Unit

Called when there's change in the search result requested by the previous MediaBrowser#search(String, LibraryParams).

Parameters
browser MediaBrowser: the browser for this event
query MediaBrowser: non-empty search query that you've specified with search(String, LibraryParams)
itemCount MediaBrowser: The item count for the search result
params MediaBrowser: library params from the library service. Can be differ from params that you've specified with search(String, LibraryParams).