Stay organized with collections
Save and categorize content based on your preferences.
BrowserRoot
class BrowserRoot
Contains information that the browser service needs to send to the client when first connected.
Summary
Constants |
static String |
The lookup key for a boolean that indicates whether the browser service should return a browser root for offline media items.
|
static String |
The lookup key for a boolean that indicates whether the browser service should return a browser root for recently played media items.
|
static String |
The lookup key for a boolean that indicates whether the browser service should return a browser root for suggested media items.
|
Public constructors |
Constructs a browser root.
|
Public methods |
Bundle! |
Gets any extras about the browser service.
|
String! |
Gets the root id for browsing.
|
Constants
static val EXTRA_OFFLINE: String
The lookup key for a boolean that indicates whether the browser service should return a browser root for offline media items.
When creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving media items that are can be played without an internet connection. If the media browser service can provide such media items, the implementation must return the key in the root hint when onGetRoot(java.lang.String,int,android.os.Bundle)
is called back.
The root hint may contain multiple keys.
Value: "android.service.media.extra.OFFLINE"
static val EXTRA_RECENT: String
The lookup key for a boolean that indicates whether the browser service should return a browser root for recently played media items.
When creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving media items that are recently played. If the media browser service can provide such media items, the implementation must return the key in the root hint when onGetRoot(java.lang.String,int,android.os.Bundle)
is called back.
The root hint may contain multiple keys.
Value: "android.service.media.extra.RECENT"
static val EXTRA_SUGGESTED: String
The lookup key for a boolean that indicates whether the browser service should return a browser root for suggested media items.
When creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving the media items suggested by the media browser service. The list of media items passed in android.media.browse.MediaBrowser.SubscriptionCallback#onChildrenLoaded(String, List)
is considered ordered by relevance, first being the top suggestion. If the media browser service can provide such media items, the implementation must return the key in the root hint when onGetRoot(java.lang.String,int,android.os.Bundle)
is called back.
The root hint may contain multiple keys.
Value: "android.service.media.extra.SUGGESTED"
Public constructors
BrowserRoot
BrowserRoot(
rootId: String,
extras: Bundle?)
Constructs a browser root.
Parameters |
rootId |
String: The root id for browsing. This value cannot be null . |
extras |
Bundle?: Any extras about the browser service. This value may be null . |
Public methods
fun getExtras(): Bundle!
Gets any extras about the browser service.
getRootId
fun getRootId(): String!
Gets the root id for browsing.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaBrowserService.BrowserRoot\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBrowserRoot\n===========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/service/media/MediaBrowserService.BrowserRoot \"View this page in Java\") \n\n```\nclass BrowserRoot\n```\n\n|---|------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.service.media.MediaBrowserService.BrowserRoot](#) |\n\nContains information that the browser service needs to send to the client when first connected.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_OFFLINE](#EXTRA_OFFLINE:kotlin.String) The lookup key for a boolean that indicates whether the browser service should return a browser root for offline media items. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_RECENT](#EXTRA_RECENT:kotlin.String) The lookup key for a boolean that indicates whether the browser service should return a browser root for recently played media items. |\n| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [EXTRA_SUGGESTED](#EXTRA_SUGGESTED:kotlin.String) The lookup key for a boolean that indicates whether the browser service should return a browser root for suggested media items. |\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [BrowserRoot](#BrowserRoot(kotlin.String,%20android.os.Bundle))`(`rootId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `extras:` `[Bundle](../../os/Bundle.html#)?`)` Constructs a browser root. |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|--------------------------------------------------------------------------|\n| [Bundle](../../os/Bundle.html#)! | [getExtras](#getExtras())`()` Gets any extras about the browser service. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getRootId](#getRootId())`()` Gets the root id for browsing. |\n\nConstants\n---------\n\n### EXTRA_OFFLINE\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_OFFLINE: String\n```\n\nThe lookup key for a boolean that indicates whether the browser service should return a browser root for offline media items.\n\nWhen creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving media items that are can be played without an internet connection. If the media browser service can provide such media items, the implementation must return the key in the root hint when [onGetRoot(java.lang.String,int,android.os.Bundle)](/reference/kotlin/android/service/media/MediaBrowserService#onGetRoot(kotlin.String,%20kotlin.Int,%20android.os.Bundle)) is called back.\n\nThe root hint may contain multiple keys. \n\n Value: \"android.service.media.extra.OFFLINE\"\n\n**See Also**\n\n- [#EXTRA_RECENT](#EXTRA_RECENT:kotlin.String)\n- [#EXTRA_SUGGESTED](#EXTRA_SUGGESTED:kotlin.String) \n\n### EXTRA_RECENT\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_RECENT: String\n```\n\nThe lookup key for a boolean that indicates whether the browser service should return a browser root for recently played media items.\n\nWhen creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving media items that are recently played. If the media browser service can provide such media items, the implementation must return the key in the root hint when [onGetRoot(java.lang.String,int,android.os.Bundle)](/reference/kotlin/android/service/media/MediaBrowserService#onGetRoot(kotlin.String,%20kotlin.Int,%20android.os.Bundle)) is called back.\n\nThe root hint may contain multiple keys. \n\n Value: \"android.service.media.extra.RECENT\"\n\n**See Also**\n\n- [#EXTRA_OFFLINE](#EXTRA_OFFLINE:kotlin.String)\n- [#EXTRA_SUGGESTED](#EXTRA_SUGGESTED:kotlin.String) \n\n### EXTRA_SUGGESTED\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val EXTRA_SUGGESTED: String\n```\n\nThe lookup key for a boolean that indicates whether the browser service should return a browser root for suggested media items.\n\nWhen creating a media browser for a given media browser service, this key can be supplied as a root hint for retrieving the media items suggested by the media browser service. The list of media items passed in [android.media.browse.MediaBrowser.SubscriptionCallback#onChildrenLoaded(String, List)](../../media/browse/MediaBrowser.SubscriptionCallback.html#onChildrenLoaded(kotlin.String,%20kotlin.collections.MutableList)) is considered ordered by relevance, first being the top suggestion. If the media browser service can provide such media items, the implementation must return the key in the root hint when [onGetRoot(java.lang.String,int,android.os.Bundle)](/reference/kotlin/android/service/media/MediaBrowserService#onGetRoot(kotlin.String,%20kotlin.Int,%20android.os.Bundle)) is called back.\n\nThe root hint may contain multiple keys. \n\n Value: \"android.service.media.extra.SUGGESTED\"\n\n**See Also**\n\n- [#EXTRA_RECENT](#EXTRA_RECENT:kotlin.String)\n- [#EXTRA_OFFLINE](#EXTRA_OFFLINE:kotlin.String)\n\nPublic constructors\n-------------------\n\n### BrowserRoot\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nBrowserRoot(\n rootId: String, \n extras: Bundle?)\n```\n\nConstructs a browser root.\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------|\n| `rootId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The root id for browsing. This value cannot be `null`. |\n| `extras` | [Bundle](../../os/Bundle.html#)?: Any extras about the browser service. This value may be `null`. |\n\nPublic methods\n--------------\n\n### getExtras\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getExtras(): Bundle!\n```\n\nGets any extras about the browser service. \n\n### getRootId\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getRootId(): String!\n```\n\nGets the root id for browsing."]]