Android-BluetoothKit icon indicating copy to clipboard operation
Android-BluetoothKit copied to clipboard

蓝牙连接上后 为什么使用一下代码获得不到配对历史

Open zuoni1018 opened this issue 6 years ago • 0 comments

  mBtAdapter = BluetoothAdapter.getDefaultAdapter();
    // 得到已配对蓝牙设备列表
    Set<BluetoothDevice> pairedDevices = mBtAdapter.getBondedDevices();
    // 如果有配对的设备,添加已配对设备到列表并显示
    if (pairedDevices.size() > 0) {
        for (BluetoothDevice device : pairedDevices) {
            searchResults.add(new SearchResult(device));
            if(searchResults.size()>3){
                //只显示3条历史数据
                break;
            }
        }
    }

zuoni1018 avatar Apr 16 '18 07:04 zuoni1018