我有一个蓝牙设备。
如果:
我想自动连接到它。这就是为什么我正在听ACTION_FOUND。
我的代码非常简单。 ACTION_BOND_STATE_CHANGED和ACTION_ACL_DISCONNECTED工作得很好。虽然我完全无法获得ACTION_FOUND。我的“INTENT RECEIVED”日志消息从未打印过......
我觉得我错过了一些简单的事情。谢谢!
SELECT
a.location,
Count(a.EMPLOYEE_NUMBER) AS [# Cook Total], --- should equal 20
(SELECT count(b.EMPLOYEE_ID) FROM Table_abc AS b where b.STATUS="Active Assignment" AND b.POSITION Like "*cook*" AND b.EMPLOYEE_ID=a.EMPLOYEE_ID) AS [# Lead Cook], --- should equal 5
FROM Table_abc AS a
ORDER BY a.location;
Results should be similar to:
Location Total Cooks Lead Cooks Total Bakers Lead Bakers
1 20 4 15 2
2 45 7 12 2
3 22 2 16 1
4 19 2 17 2
5 5 1 9 1
答案 0 :(得分:0)
我相信ACTION_FOUND事件仅在您运行设备发现时触发,意图将您的设备与另一个设备配对。当已经配对的设备重新进入范围时,它不会触发。不幸的是,似乎没有您想要的案例。
最好的办法是在连接丢失时启动AsycTask或Thread,并尝试重新连接直到成功或直到达到任意时间限制并放弃。