由网友(酒醉人不归)分享简介:我想有一个广播接收器监听连接BT的设备。有谁告诉我哪广播我要听?我试图 android.bluetooth.device.action.ACL_CONNECTED ,但它似乎并没有工作。I want to have a broadcast receiver listening for BT devices conne...
我想有一个广播接收器监听连接BT的设备。有谁告诉我哪广播我要听?我试图 android.bluetooth.device.action.ACL_CONNECTED
,但它似乎并没有工作。
I want to have a broadcast receiver listening for BT devices connecting.
Could anybody tell me which broadcast I have to listen to?
I tried android.bluetooth.device.action.ACL_CONNECTED
but it doesn't seem to work.
感谢您。
推荐答案
您可以通过使用 BroadcastReceiver.onReceive()
函数里以下拉设备:
You can pull the device by using the following inside your BroadcastReceiver.onReceive()
function:
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
相关推荐
最新文章