Google は、黒人コミュニティに対する人種平等の促進に取り組んでいます。取り組みを見る

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, @IntRange(0) 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, @IntRange(0) 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,
    @IntRange(0) 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 String: non-empty parent id that you've specified with subscribe(String, LibraryParams)
itemCount Int: number of children
params MediaLibraryService.LibraryParams?: 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,
    @IntRange(0) 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 String: non-empty search query that you've specified with search(String, LibraryParams)
itemCount Int: The item count for the search result
params MediaLibraryService.LibraryParams?: library params from the library service. Can be differ from params that you've specified with search(String, LibraryParams).