[英]how to wait till bluetooth is disconnected android
我要在活动结束时关闭蓝牙。 由于断开蓝牙的调用是异步的,因此在完全断开蓝牙连接之前,它将转到另一个活动。 此行为使应用程序挂起,直到蓝牙断开连接。 因此,我打算显示对话框直到蓝牙断开。 关于如何实现它的任何想法?
您可能应该将Broadcast Receiver与BluetoothDevice.ACTION_ACL_DISCONNECTED
。
请参阅: http : //developer.android.com/reference/android/bluetooth/BluetoothDevice.html#ACTION_ACL_DISCONNECTED
例如,您可以参考: http : //b2cloud.com.au/tutorial/listening-to-bluetooth-connections/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.