Stay organized with collections
Save and categorize content based on your preferences.
DeviceSuggestionsUpdatesCallback
interface DeviceSuggestionsUpdatesCallback
Callback for receiving events about device suggestions
Summary
Public methods |
abstract Unit |
Called when suggestions are cleared.
|
abstract Unit |
Called when a router requests a suggestion from suggestion providers.
|
abstract Unit |
Called when suggestions are updated.
|
Public methods
onSuggestionsCleared
abstract fun onSuggestionsCleared(suggestingPackageName: String): Unit
Called when suggestions are cleared.
Parameters |
suggestingPackageName |
String: the package that cleared their provided suggestions. This value cannot be null . |
onSuggestionsRequested
abstract fun onSuggestionsRequested(): Unit
Called when a router requests a suggestion from suggestion providers.
onSuggestionsUpdated
abstract fun onSuggestionsUpdated(
suggestingPackageName: String,
suggestedDeviceInfo: MutableList<SuggestedDeviceInfo!>
): Unit
Called when suggestions are updated.
Parameters |
suggestingPackageName |
String: the package that provided the suggestions. This value cannot be null . |
suggestedDeviceInfo |
MutableList<SuggestedDeviceInfo!>: the suggestions provided by the package. This value cannot be null . |
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-08-20 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-08-20 UTC."],[],[],null,["# MediaRouter2.DeviceSuggestionsUpdatesCallback\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDeviceSuggestionsUpdatesCallback\n================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaRouter2.DeviceSuggestionsUpdatesCallback \"View this page in Java\") \n\n```\ninterface DeviceSuggestionsUpdatesCallback\n```\n\n|------------------------------------------------------------------|\n| [android.media.MediaRouter2.DeviceSuggestionsUpdatesCallback](#) |\n\nCallback for receiving events about device suggestions\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSuggestionsCleared](#onSuggestionsCleared(kotlin.String))`(`suggestingPackageName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`)` Called when suggestions are cleared. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSuggestionsRequested](#onSuggestionsRequested())`()` Called when a router requests a suggestion from suggestion providers. |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onSuggestionsUpdated](#onSuggestionsUpdated(kotlin.String,%20kotlin.collections.MutableList))`(`suggestingPackageName:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `suggestedDeviceInfo:` `[MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\u003c[SuggestedDeviceInfo](/reference/kotlin/android/media/SuggestedDeviceInfo)!\u003e`)` Called when suggestions are updated. |\n\nPublic methods\n--------------\n\n### onSuggestionsCleared\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onSuggestionsCleared(suggestingPackageName: String): Unit\n```\n\nCalled when suggestions are cleared.\n\n| Parameters ||\n|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `suggestingPackageName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): the package that cleared their provided suggestions. This value cannot be `null`. |\n\n### onSuggestionsRequested\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onSuggestionsRequested(): Unit\n```\n\nCalled when a router requests a suggestion from suggestion providers. \n\n### onSuggestionsUpdated\n\nAdded in [API level Baklava](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onSuggestionsUpdated(\n suggestingPackageName: String, \n suggestedDeviceInfo: MutableList\u003cSuggestedDeviceInfo!\u003e\n): Unit\n```\n\nCalled when suggestions are updated.\n\n| Parameters ||\n|-------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `suggestingPackageName` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): the package that provided the suggestions. This value cannot be `null`. |\n| `suggestedDeviceInfo` | [MutableList](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-mutable-list/index.html)\\\u003c[SuggestedDeviceInfo](/reference/kotlin/android/media/SuggestedDeviceInfo)!\\\u003e: the suggestions provided by the package. This value cannot be `null`. |"]]