Reputation: 3224
I am switching off the bluetooth on my activity finish. As the calls to disconnect bluetooth are asynchronous, it is going to another activity before completely disconnecting the bluetooth. This behaviour is making the app to hang till the bluetooth is disconnected. So, I am planning to display dialog till bluetooth is disconnected. Any idea on how to achieve it?
Upvotes: 0
Views: 124
Reputation: 548
You should probably use a Broadcast Receiver with BluetoothDevice.ACTION_ACL_DISCONNECTED
.
For an example, you may refer : http://b2cloud.com.au/tutorial/listening-to-bluetooth-connections/
Upvotes: 1