Stay organized with collections
Save and categorize content based on your preferences.
OnModeChangedListener
interface OnModeChangedListener
Interface definition of a callback that is notified when the audio mode changes
Summary
Public methods |
abstract Unit |
Called on the listener to indicate that the audio mode has changed
|
Public methods
onModeChanged
abstract fun onModeChanged(mode: Int): Unit
Called on the listener to indicate that the audio mode has 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-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,["# AudioManager.OnModeChangedListener\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnModeChangedListener\n=====================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/AudioManager.OnModeChangedListener \"View this page in Java\") \n\n```\ninterface OnModeChangedListener\n```\n\n|-------------------------------------------------------|\n| [android.media.AudioManager.OnModeChangedListener](#) |\n\nInterface definition of a callback that is notified when the audio mode changes\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onModeChanged](#onModeChanged(kotlin.Int))`(`mode:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Called on the listener to indicate that the audio mode has changed |\n\nPublic methods\n--------------\n\n### onModeChanged\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onModeChanged(mode: Int): Unit\n```\n\nCalled on the listener to indicate that the audio mode has changed\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mode` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): The current audio mode Value is [android.media.AudioManager#MODE_NORMAL](/reference/kotlin/android/media/AudioManager#MODE_NORMAL:kotlin.Int), [android.media.AudioManager#MODE_RINGTONE](/reference/kotlin/android/media/AudioManager#MODE_RINGTONE:kotlin.Int), [android.media.AudioManager#MODE_IN_CALL](/reference/kotlin/android/media/AudioManager#MODE_IN_CALL:kotlin.Int), [android.media.AudioManager#MODE_IN_COMMUNICATION](/reference/kotlin/android/media/AudioManager#MODE_IN_COMMUNICATION:kotlin.Int), [android.media.AudioManager#MODE_CALL_SCREENING](/reference/kotlin/android/media/AudioManager#MODE_CALL_SCREENING:kotlin.Int), [android.media.AudioManager#MODE_CALL_REDIRECT](/reference/kotlin/android/media/AudioManager#MODE_CALL_REDIRECT:kotlin.Int), [android.media.AudioManager#MODE_COMMUNICATION_REDIRECT](/reference/kotlin/android/media/AudioManager#MODE_COMMUNICATION_REDIRECT:kotlin.Int), or [android.media.AudioManager#MODE_ASSISTANT_CONVERSATION](/reference/kotlin/android/media/AudioManager#MODE_ASSISTANT_CONVERSATION:kotlin.Int) |"]]