2016-05-13 56 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

噢,我的!物理連接/斷開我的耳機以排除故障。感謝您指出。工作正常。 –