Android APIs
public abstract class

AudioDeviceCallback

extends Object
java.lang.Object
   ↳ android.media.AudioDeviceCallback

Class Overview

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

Summary

Public Constructors
AudioDeviceCallback()
Public Methods
void onAudioDevicesAdded(AudioDeviceInfo[] addedDevices)
Called by the AudioManager to indicate that one or more audio devices have been connected.
void onAudioDevicesRemoved(AudioDeviceInfo[] removedDevices)
Called by the AudioManager to indicate that one or more audio devices have been disconnected.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public AudioDeviceCallback ()

Added in API level 23

Public Methods

public void onAudioDevicesAdded (AudioDeviceInfo[] addedDevices)

Added in API level 23

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

Parameters
addedDevices An array of AudioDeviceInfo objects corresponding to any newly added audio devices.

public void onAudioDevicesRemoved (AudioDeviceInfo[] removedDevices)

Added in API level 23

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

Parameters
removedDevices An array of AudioDeviceInfo objects corresponding to any newly removed audio devices.