Added in API level 23

AudioDeviceCallback


abstract class AudioDeviceCallback
kotlin.Any
   ↳ android.media.AudioDeviceCallback

AudioDeviceCallback defines the mechanism by which applications can receive notifications of audio device connection and disconnection events.

Summary

Public constructors

Public methods
open Unit

Called by the AudioManager to indicate that one or more audio devices have been connected.

open Unit

Called by the AudioManager to indicate that one or more audio devices have been disconnected.

Public constructors

AudioDeviceCallback

AudioDeviceCallback()

Public methods

onAudioDevicesAdded

Added in API level 23
open fun onAudioDevicesAdded(addedDevices: Array<AudioDeviceInfo!>!): Unit

Called by the AudioManager to indicate that one or more audio devices have been connected.

Parameters
addedDevices Array<AudioDeviceInfo!>!: An array of AudioDeviceInfo objects corresponding to any newly added audio devices.

onAudioDevicesRemoved

Added in API level 23
open fun onAudioDevicesRemoved(removedDevices: Array<AudioDeviceInfo!>!): Unit

Called by the AudioManager to indicate that one or more audio devices have been disconnected.

Parameters
removedDevices Array<AudioDeviceInfo!>!: An array of AudioDeviceInfo objects corresponding to any newly removed audio devices.