Handling Bluetooth Disabling Gracefully
Is there a way to gracefully handle the toggling of Bluetooth from the phone while a connection is already established? I am able to register a broadcast receiver to handle the events STATE_TURNING_OFF and STATE_OFF. The Android API docs recommend gracefully disconnecting from any Bluetooth devices when the message STATE_TURNING_OFF is received, since the STATE_OFF message is not received until about 1-2 seconds (at least on my device) afterward. However, I'm unable to disconnect properly from the device in that time it seems. And I found that if I do not properly disconnect from the Metawear, then I cannot re-establish a connection without removing the battery. Any thoughts?
This discussion has been closed.