小编Tor*_*ula的帖子

获取 Android 上可用的蓝牙设备列表

这个问题中,@nhoxbypass 提供了此方法,用于将找到的蓝牙设备添加到列表中:

private BroadcastReceiver myReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            Message msg = Message.obtain();
            String action = intent.getAction();
            if(BluetoothDevice.ACTION_FOUND.equals(action)){
               //Found, add to a device list
            }           
        }
    };
Run Code Online (Sandbox Code Playgroud)

但是,我不明白如何获得对找到的设备的引用,这该怎么做?

我无权对原始问题发表评论,所以我选择在这里扩展它。

java android bluetooth android-bluetooth

5
推荐指数
1
解决办法
7484
查看次数

标签 统计

android ×1

android-bluetooth ×1

bluetooth ×1

java ×1