【发布时间】:2012-05-02 09:30:41
【问题描述】:
当蓝牙与设备断开连接时,我正在尝试“捕捉”。 我正在使用此代码:
if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)){
deleteNotification();
setWarningState(WarningState.RedWarning);
showNotification("You are parked");
但是当我通过关闭远程设备或通过关闭手机中的蓝牙切换来断开蓝牙连接时,它不会进入此状态。
当我使用这个时:
BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)
它工作正常(当建立连接时)。 为什么会这样,我怎样才能让它工作? 谢谢!
【问题讨论】:
标签: android bluetooth broadcastreceiver