2016-05-13 55 views
0

我创建了一个接收器,当我的耳机连接到我的测试设备时,我能够接收android.bluetooth.device.action.ACL_CONNECTED,但是当我手动断开连接或关闭耳机,它没有广播任何东西。我期待收到“android.bluetooth.device.action.ACTION_ACL_DISCONNECTED”。android:接收器在蓝牙设备断开连接时没有收到任何广播

我有我的接收器,这些意图过滤声明:

  <action android:name="android.bluetooth.adapter.action.DISCOVERY_FINISHED" /> 
      <action android:name="android.bluetooth.device.action.ACL_CONNECTED" /> 
      <action android:name="android.bluetooth.device.action.ACTION_FOUND" /> 
      <action android:name="android.bluetooth.device.action.ACTION_ACL_DISCONNECT_REQUESTED" /> 
      <action android:name="android.bluetooth.device.action.ACTION_ACL_DISCONNECTED" /> 

额外的信息:我的测试设备运行的是Android 6。

任何想法为什么?或者我错过了什么?

谢谢。

回答

0

有一个错字,动作要(字符串中没有ACTION_):

<action android:name="android.bluetooth.device.action.ACL_DISCONNECTED" /> 
+0

噢,我的!物理连接/断开我的耳机以排除故障。感谢您指出。工作正常。 –