簡體   English   中英

如何等待直到藍牙斷開android

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM