Detect if bluetooth headset connected
Working on a VOIP application, in silent mode an alert tone or ringtone should play on bluetooth headset only. Able to play it on headphone if connected but if the headset is not connected the tone plays on the speaker though the mobile is in silent mode. Someone please explain if there is a way to detect that a bluetooth headset is connected. For Bluetooth Headset you can use getConnectedDevices() Reference: http://developer.android.com/reference/android/bluetooth/BluetoothHeadset.html Here is my code: /** */ class BluetoothStateMonitor(private val appContext: Context): BroadcastReceiver(),