Stay organized with collections
Save and categorize content based on your preferences.
ControllerCallback
abstract class ControllerCallback
Callback for receiving RoutingController
updates.
Summary
Public methods |
open Unit |
Called when a controller is updated.
|
Public constructors
ControllerCallback
ControllerCallback()
Public methods
onControllerUpdated
open fun onControllerUpdated(controller: MediaRouter2.RoutingController): Unit
Called when a controller is updated. (e.g., when the selected routes of the controller is changed or when the volume of the controller is changed.)
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,["# MediaRouter2.ControllerCallback\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nControllerCallback\n==================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaRouter2.ControllerCallback \"View this page in Java\") \n\n```\nabstract class ControllerCallback\n```\n\n|---|----------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaRouter2.ControllerCallback](#) |\n\nCallback for receiving [RoutingController](/reference/kotlin/android/media/MediaRouter2.RoutingController) updates.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------|---|\n| [ControllerCallback](#ControllerCallback())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onControllerUpdated](#onControllerUpdated(android.media.MediaRouter2.RoutingController))`(`controller:` `[MediaRouter2.RoutingController](/reference/kotlin/android/media/MediaRouter2.RoutingController)`)` Called when a controller is updated. |\n\nPublic constructors\n-------------------\n\n### ControllerCallback\n\n```\nControllerCallback()\n```\n\nPublic methods\n--------------\n\n### onControllerUpdated\n\nAdded in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onControllerUpdated(controller: MediaRouter2.RoutingController): Unit\n```\n\nCalled when a controller is updated. (e.g., when the selected routes of the controller is changed or when the volume of the controller is changed.)\n\n| Parameters ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `controller` | [MediaRouter2.RoutingController](/reference/kotlin/android/media/MediaRouter2.RoutingController): the updated controller. It may be the [system controller](/reference/kotlin/android/media/MediaRouter2#getSystemController()). This value cannot be `null`. |\n\n**See Also**\n\n- [#getSystemController()](/reference/kotlin/android/media/MediaRouter2#getSystemController())"]]