MediaBrowserCompat

public final class MediaBrowserCompat
extends Object

java.lang.Object
   ↳ android.support.v4.media.MediaBrowserCompat


Browses media content offered by a MediaBrowserServiceCompat.

The app targeting API level 30 or higher must include a <queries> element in their manifest to connect to a media browser service in another app. See the following example and this guide for more information.

<!-- As an intent action -->
 <intent>
   <action android:name="android.media.browse.MediaBrowserService" />
 </intent>
 <!-- Or, as a package name -->
 <package android:name="package_name_of_the_other_app" />
 

This object is not thread-safe. All calls should happen on the thread on which the browser was constructed. All callback methods will be called from the thread on which the browser was constructed.

Developer Guides

For information about building your media application, read the Media Apps developer guide.

Summary

Nested classes

class MediaBrowserCompat.ConnectionCallback

Callbacks for connection related events. 

class MediaBrowserCompat.CustomActionCallback

Callback for receiving the result of MediaBrowserCompat.sendCustomAction(String, Bundle, MediaBrowserCompat.CustomActionCallback)

class MediaBrowserCompat.ItemCallback

Callback for receiving the result of MediaBrowserCompat.getItem(String, MediaBrowserCompat.ItemCallback)

class MediaBrowserCompat.MediaItem

A class with information on a single media item for use in browsing/searching media. 

class MediaBrowserCompat.SearchCallback

Callback for receiving the result of MediaBrowserCompat.search(String, Bundle, MediaBrowserCompat.SearchCallback)

class MediaBrowserCompat.SubscriptionCallback

Callbacks for subscription related events. 

Constants

String CUSTOM_ACTION_DOWNLOAD

Predefined custom action to ask the connected service to download a specific MediaBrowserCompat.MediaItem for offline playback.

String CUSTOM_ACTION_REMOVE_DOWNLOADED_FILE

Predefined custom action to ask the connected service to remove the downloaded file of MediaBrowserCompat.MediaItem by the download action.

String EXTRA_DOWNLOAD_PROGRESS

Used as a float extra field to denote the current progress during download.

String EXTRA_MEDIA_ID

Used as a string extra field to denote the target MediaBrowserCompat.MediaItem.

String EXTRA_PAGE

Used as an int extra field to denote the page number to subscribe.

String