Android-配对对话框不出现
创始人
2024-08-19 20:00:43
0
  1. 确认bluetooth权限已经添加到AndroidManifest.xml文件中

  2. 确认BluetoothAdapter已经启用

    BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (bluetoothAdapter == null || !bluetoothAdapter.isEnabled()) { Intent enableBluetoothIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE); startActivityForResult(enableBluetoothIntent, REQUEST_ENABLE_BT); }

  3. 确认已经被发现

    Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE); discoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, DISCOVERABLE_DURATION); startActivity(discoverableIntent);

  4. 确认已经配对

    Set pairedDevices = bluetoothAdapter.getBondedDevices(); if (pairedDevices.size() > 0) { for (BluetoothDevice device : pairedDevices) { Log.d(TAG, "Paired device found: " + device.getName() + " (" + device.getAddress() + ")"); } }

  5. 确认已经开始配对

    BluetoothDevice device = bluetoothAdapter.getRemoteDevice(deviceAddress); device.createBond();

相关内容

热门资讯

黑科技脚本!德扑之星系统发牌机... 自定义wepokeai代打系统规律,只需要输入自己想要的开挂功能,一键便可以生成出微扑克专用辅助器,...
黑科技肯定!aapoker透明... 黑科技肯定!aapoker透明挂辅助器(德扑ai智能机器人)切实真的是有挂(有挂细节)-哔哩哔哩1、...
黑科技好友!wepoke真的有... 您好,aapoker发牌机制这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多...
辅助黑科技!wepoke辅助德... 辅助黑科技!wepoke辅助德之星(德州ai辅助软件)一直是真的有挂(有挂神器)-哔哩哔哩是一款可以...
黑科技好友!云扑克德州辅助器免... 黑科技好友!云扑克德州辅助器免费(aapokerai辅助)真是存在有挂(真的有挂)-哔哩哔哩1、aa...
黑科技真的!来玩app辅助(德... 黑科技真的!来玩app辅助(德扑ai智能机器人线上代打)其实有挂(有挂规律)-哔哩哔哩1、金币登录送...
黑科技新版!推扑克辅助器(德州... 黑科技新版!推扑克辅助器(德州ai软件购买)真是存在有挂(有挂方式)-哔哩哔哩;无聊就玩这款德州ai...
黑科技教程!pokerist有... 您好,wepoke透明黑科技这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多...
黑科技肯定!fishpoker... 黑科技肯定!fishpoker大菠萝外挂(aapoker发牌机制)切实真的有挂(有挂秘笈)-哔哩哔哩...
黑科技有挂!pokernow可... 黑科技有挂!pokernow可以加注(德扑ai软件靠谱吗)往昔是真的有挂(有挂教程)-哔哩哔哩是一款...