Stay organized with collections
Save and categorize content based on your preferences.
OnRoutingChangedListener
interface OnRoutingChangedListener : AudioRouting.OnRoutingChangedListener
Defines the interface by which applications can receive notifications of routing changes for the associated AudioTrack
.
Summary
Public methods |
open Unit |
|
abstract Unit |
Called when the routing of an AudioTrack changes from either and explicit or policy rerouting.
|
Public methods
onRoutingChanged
open fun onRoutingChanged(router: AudioRouting!): Unit
Deprecated: Deprecated in Java.
onRoutingChanged
abstract fun onRoutingChanged(audioTrack: AudioTrack!): Unit
Deprecated: Deprecated in Java.
Called when the routing of an AudioTrack changes from either and explicit or policy rerouting. Use getRoutedDevice()
to retrieve the newly routed-to device.
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,["# AudioTrack.OnRoutingChangedListener\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnRoutingChangedListener\n========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/AudioTrack.OnRoutingChangedListener \"View this page in Java\") \n\n```\ninterface OnRoutingChangedListener : AudioRouting.OnRoutingChangedListener\n```\n\n|--------------------------------------------------------|\n| [android.media.AudioTrack.OnRoutingChangedListener](#) |\n\n*** ** * ** ***\n\n| **This interface was deprecated in API level 24.**\n|\n| users should switch to the general purpose [AudioRouting.OnRoutingChangedListener](/reference/kotlin/android/media/AudioRouting.OnRoutingChangedListener) class instead.\n\nDefines the interface by which applications can receive notifications of routing changes for the associated [AudioTrack](/reference/kotlin/android/media/AudioTrack).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRoutingChanged](#onRoutingChanged(android.media.AudioRouting))`(`router:` `[AudioRouting](/reference/kotlin/android/media/AudioRouting)!`)` \u003cbr /\u003e |\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onRoutingChanged](#onRoutingChanged(android.media.AudioTrack))`(`audioTrack:` `[AudioTrack](/reference/kotlin/android/media/AudioTrack)!`)` Called when the routing of an AudioTrack changes from either and explicit or policy rerouting. |\n\nPublic methods\n--------------\n\n### onRoutingChanged\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onRoutingChanged(router: AudioRouting!): Unit\n```\n\n**Deprecated:** *Deprecated in Java.* \n\n### onRoutingChanged\n\nAdded in [API level 23](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onRoutingChanged(audioTrack: AudioTrack!): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCalled when the routing of an AudioTrack changes from either and explicit or policy rerouting. Use [getRoutedDevice()](/reference/kotlin/android/media/AudioTrack#getRoutedDevice()) to retrieve the newly routed-to device."]]