Stay organized with collections
Save and categorize content based on your preferences.
OnCommunicationDeviceChangedListener
interface OnCommunicationDeviceChangedListener
Listener registered by client to be notified upon communication audio device change. See setCommunicationDevice(android.media.AudioDeviceInfo)
.
Summary
Public methods |
abstract Unit |
Callback method called upon communication audio device change.
|
Public methods
onCommunicationDeviceChanged
abstract fun onCommunicationDeviceChanged(device: AudioDeviceInfo?): Unit
Callback method called upon communication audio device change.
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,["# AudioManager.OnCommunicationDeviceChangedListener\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnCommunicationDeviceChangedListener\n====================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/AudioManager.OnCommunicationDeviceChangedListener \"View this page in Java\") \n\n```\ninterface OnCommunicationDeviceChangedListener\n```\n\n|----------------------------------------------------------------------|\n| [android.media.AudioManager.OnCommunicationDeviceChangedListener](#) |\n\nListener registered by client to be notified upon communication audio device change. See [setCommunicationDevice(android.media.AudioDeviceInfo)](/reference/kotlin/android/media/AudioManager#setCommunicationDevice(android.media.AudioDeviceInfo)).\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onCommunicationDeviceChanged](#onCommunicationDeviceChanged(android.media.AudioDeviceInfo))`(`device:` `[AudioDeviceInfo](/reference/kotlin/android/media/AudioDeviceInfo)?`)` Callback method called upon communication audio device change. |\n\nPublic methods\n--------------\n\n### onCommunicationDeviceChanged\n\nAdded in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onCommunicationDeviceChanged(device: AudioDeviceInfo?): Unit\n```\n\nCallback method called upon communication audio device change.\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `device` | [AudioDeviceInfo](/reference/kotlin/android/media/AudioDeviceInfo)?: the audio device requested for communication use cases. Can be null on platforms not supporting [android.content.pm.PackageManager#FEATURE_TELEPHONY](../content/pm/PackageManager.html#FEATURE_TELEPHONY:kotlin.String). |"]]