首页 新闻 搜索 专区 学院

连接蓝牙错误isSocketAllowedBySecurityPolicy start : device null

0
[已关闭问题] 关闭于 2020-07-04 15:55
public class ClientThread extends Thread {
    private BluetoothDevice device;
    private static String uuid = "00001601-0000-1000-8163-00805fXXXX";
    public ClientThread(BluetoothDevice device){
        this.device = device;
    }

    @Override
    public void run() {
        super.run();
        ParcelUuid[] uid = device.getUuids();
        try {
            BluetoothSocket socket = device.createRfcommSocketToServiceRecord(UUID.fromString(uuid));
            socket.connect();
        }catch (IOException e){
            e.printStackTrace();
            Log.e("error:","错误:", e);
        }
    }
}

错误:

D/ViewRootImpl@8749aa5[MainActivity]: ViewPostIme pointer 0
D/ViewRootImpl@8749aa5[MainActivity]: ViewPostIme pointer 1
D/BluetoothUtils: isSocketAllowedBySecurityPolicy start : device null
W/BluetoothAdapter: getBluetoothService() called with no BluetoothManagerCallback

不知道是什么原因??

还没有的主页 还没有 | 菜鸟二级 | 园豆:495
提问于:2020-07-02 17:51
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册