Stay organized with collections
Save and categorize content based on your preferences.
AudioTrack.OnRoutingChangedListener
public
static
interface
AudioTrack.OnRoutingChangedListener
implements
AudioRouting.OnRoutingChangedListener
android.media.AudioTrack.OnRoutingChangedListener
|
This interface was deprecated
in API level 24.
users should switch to the general purpose
AudioRouting.OnRoutingChangedListener
class instead.
Defines the interface by which applications can receive notifications of
routing changes for the associated AudioTrack
.
Summary
Public methods
public abstract void onRoutingChanged (AudioTrack audioTrack)
Called when the routing of an AudioTrack changes from either and
explicit or policy rerouting. Use AudioTrack.getRoutedDevice()
to
retrieve the newly routed-to device.
Parameters |
audioTrack |
AudioTrack |
public void onRoutingChanged (AudioRouting router)
Parameters |
router |
AudioRouting |
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.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# AudioTrack.OnRoutingChangedListener\n\nAdded in [API level 23](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n24](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nAudioTrack.OnRoutingChangedListener\n===================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/media/AudioTrack.OnRoutingChangedListener \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nAudioTrack.OnRoutingChangedListener\n`\n\n\n`\n\n\nimplements\n\n`[AudioRouting.OnRoutingChangedListener](/reference/android/media/AudioRouting.OnRoutingChangedListener)`\n\n\n`\n\n|---------------------------------------------------|\n| android.media.AudioTrack.OnRoutingChangedListener |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This interface was deprecated\nin API level 24.** \n\nusers should switch to the general purpose\n[AudioRouting.OnRoutingChangedListener](/reference/android/media/AudioRouting.OnRoutingChangedListener) class instead.\n\nDefines the interface by which applications can receive notifications of\nrouting changes for the associated [AudioTrack](/reference/android/media/AudioTrack).\n\nSummary\n-------\n\n| ### Public methods ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract void` | ` `[onRoutingChanged](/reference/android/media/AudioTrack.OnRoutingChangedListener#onRoutingChanged(android.media.AudioTrack))`(`[AudioTrack](/reference/android/media/AudioTrack)` audioTrack) ` Called when the routing of an AudioTrack changes from either and explicit or policy rerouting. |\n| ` default void` | ` `[onRoutingChanged](/reference/android/media/AudioTrack.OnRoutingChangedListener#onRoutingChanged(android.media.AudioRouting))`(`[AudioRouting](/reference/android/media/AudioRouting)` router) ` |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From interface ` `[android.media.AudioRouting.OnRoutingChangedListener](/reference/android/media/AudioRouting.OnRoutingChangedListener)` ` |------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[onRoutingChanged](/reference/android/media/AudioRouting.OnRoutingChangedListener#onRoutingChanged(android.media.AudioRouting))`(`[AudioRouting](/reference/android/media/AudioRouting)` router) ` | ||\n\nPublic methods\n--------------\n\n### onRoutingChanged\n\nAdded in [API level 23](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract void onRoutingChanged (AudioTrack audioTrack)\n```\n\nCalled when the routing of an AudioTrack changes from either and\nexplicit or policy rerouting. Use [AudioTrack.getRoutedDevice()](/reference/android/media/AudioTrack#getRoutedDevice()) to\nretrieve the newly routed-to device.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------------|---------------------|\n| `audioTrack` | `AudioTrack` \u003cbr /\u003e |\n\n### onRoutingChanged\n\nAdded in [API level 24](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n24](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void onRoutingChanged (AudioRouting router)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|-----------------------|\n| `router` | `AudioRouting` \u003cbr /\u003e |"]]