The notification on any addition or modification in the Audio Devices such as earphones or headphones connected to the Mobile device is provided through the following Callbacks:
Callbacks:
onNotifyDeviceUpdate– Acknowledgment to the user when a switch to alternate media devices is made at run-time.onDeviceAdded– Notification to the user when a new Audio Device is connected.onDeviceRemoved– Notification to the user when an Audio Device is disconnected.
public void onDeviceAdded(String message) {
// New Device added
}
public void onDeviceRemoved(String message) {
// Device removed
}
public void onNotifyDeviceUpdate (String message) {
// Device switched
}
