public interface

MediaBrowser.Listener

implements MediaController.Listener

 androidx.media3.session.MediaBrowser.Listener

Overview

A listener for events from MediaLibraryService.

The methods will be called from the application thread associated with the application looper of the controller.

Summary

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.

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 method 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: The non-empty parent id that you've specified with MediaBrowser.Listener.
itemCount: The number of children.
params: The optional parameters from the library service. Can be differ from the params that you've specified with MediaBrowser.Listener.

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: The non-empty search query that you've specified with MediaBrowser.Listener.
itemCount: The number of items for the search result.
params: The optional parameters from the library service. Can be differ from the params that you've specified with MediaBrowser.Listener.