Stay organized with collections
Save and categorize content based on your preferences.
ItemCallback
abstract class ItemCallback
Callback for receiving the result of getItem
.
Summary
Public methods |
open Unit |
Called there was an error retrieving it or the connected service doesn't support getItem .
|
open Unit |
Called when the item has been returned by the connected service.
|
Public constructors
ItemCallback
ItemCallback()
Public methods
onError
open fun onError(mediaId: String): Unit
Called there was an error retrieving it or the connected service doesn't support getItem
.
Parameters |
mediaId |
String: The media id of the media item which could not be loaded. This value cannot be null . |
onItemLoaded
open fun onItemLoaded(item: MediaBrowser.MediaItem!): Unit
Called when the item has been returned by the connected service.
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,["# MediaBrowser.ItemCallback\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nItemCallback\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/browse/MediaBrowser.ItemCallback \"View this page in Java\") \n\n```\nabstract class ItemCallback\n```\n\n|---|-----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.browse.MediaBrowser.ItemCallback](#) |\n\nCallback for receiving the result of [getItem](/reference/kotlin/android/media/browse/MediaBrowser#getItem(kotlin.String,%20android.media.browse.MediaBrowser.ItemCallback)).\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------|---|\n| [ItemCallback](#ItemCallback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onError](#onError(kotlin.String))`(`mediaId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Called there was an error retrieving it or the connected service doesn't support [getItem](/reference/kotlin/android/media/browse/MediaBrowser#getItem(kotlin.String,%20android.media.browse.MediaBrowser.ItemCallback)). |\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onItemLoaded](#onItemLoaded(android.media.browse.MediaBrowser.MediaItem))`(`item:` `[MediaBrowser.MediaItem](/reference/kotlin/android/media/browse/MediaBrowser.MediaItem)!`)` Called when the item has been returned by the connected service. |\n\nPublic constructors\n-------------------\n\n### ItemCallback\n\n```\nItemCallback()\n```\n\nPublic methods\n--------------\n\n### onError\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onError(mediaId: String): Unit\n```\n\nCalled there was an error retrieving it or the connected service doesn't support [getItem](/reference/kotlin/android/media/browse/MediaBrowser#getItem(kotlin.String,%20android.media.browse.MediaBrowser.ItemCallback)).\n\n| Parameters ||\n|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mediaId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The media id of the media item which could not be loaded. This value cannot be `null`. |\n\n### onItemLoaded\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onItemLoaded(item: MediaBrowser.MediaItem!): Unit\n```\n\nCalled when the item has been returned by the connected service.\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------|\n| `item` | [MediaBrowser.MediaItem](/reference/kotlin/android/media/browse/MediaBrowser.MediaItem)!: The item that was returned or null if it doesn't exist. |"]]