public class

MediaBrowser.BrowserCallback

extends MediaController.ControllerCallback

 java.lang.Object

androidx.media2.session.MediaController.ControllerCallback

↳androidx.media2.session.MediaBrowser.BrowserCallback

Overview

Callback to listen events from MediaLibraryService.

Summary

Constructors
publicBrowserCallback()

Methods
public voidonChildrenChanged(MediaBrowser browser, java.lang.String parentId, int itemCount, MediaLibraryService.LibraryParams params)

Called when there's change in the parent's children after you've subscribed to the parent with MediaBrowser.subscribe(String, MediaLibraryService.LibraryParams).

public voidonSearchResultChanged(MediaBrowser browser, java.lang.String query, int itemCount, MediaLibraryService.LibraryParams params)

Called when there's change in the search result requested by the previous MediaBrowser.

from MediaController.ControllerCallbackonAllowedCommandsChanged, onBufferingStateChanged, onConnected, onCurrentMediaItemChanged, onCustomCommand, onDisconnected, onPlaybackCompleted, onPlaybackInfoChanged, onPlaybackSpeedChanged, onPlayerStateChanged, onPlaylistChanged, onPlaylistMetadataChanged, onRepeatModeChanged, onSeekCompleted, onSetCustomLayout, onShuffleModeChanged, onSubtitleData, onTrackDeselected, onTracksChanged, onTrackSelected, onVideoSizeChanged, onVideoSizeChanged
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public BrowserCallback()

Methods

public void onChildrenChanged(MediaBrowser browser, java.lang.String parentId, int itemCount, MediaLibraryService.LibraryParams params)

Called when there's change in the parent's children after you've subscribed to the parent with MediaBrowser.subscribe(String, MediaLibraryService.LibraryParams).

This API is called when the library service called MediaLibraryService.MediaLibrarySession.notifyChildrenChanged(MediaSession.ControllerInfo, String, int, MediaLibraryService.LibraryParams) for the parent.

Parameters:

browser: the browser for this event
parentId: non-empty parent id that you've specified with MediaBrowser.BrowserCallback
itemCount: number of children
params: library params from the library service. Can be differ from params that you've specified with MediaBrowser.BrowserCallback.

public void onSearchResultChanged(MediaBrowser browser, java.lang.String query, int itemCount, MediaLibraryService.LibraryParams params)

Called when there's change in the search result requested by the previous MediaBrowser.

Parameters:

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