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();

相关内容

热门资讯

wepoke透明挂!wepow... wepoke透明挂!wepower轻量版辅助器,(wEpoKe)其实真的是有挂,分享教程(黑科技辅助...
wepoke透明挂使用方法!w... wepoke透明挂使用方法!wepower微扑克有无外挂,(wePoKe)一贯存在有挂,系统教程(黑...
德扑之星ai代打!德扑ai软件... 德扑之星ai代打!德扑ai软件购买,(德扑ai)好像是有挂,详细教程(黑科技功能)1、德扑之星ai代...
aapoker有作弊吗!aa扑... aapoker有作弊吗!aa扑克辅助,(AAPOKEr)一贯是真的有挂,新2025教程(黑科技攻略)...
微扑克ai辅助神器!wpk智能... 微扑克ai辅助神器!wpk智能ai,(WpK)一贯是有挂,AI教程(黑科技教程)1、微扑克ai辅助神...
aapoker辅助工具ai!a... aapoker辅助工具ai!aapoker外挂实测,(aaPoker)好像是有挂,揭秘攻略(黑科技辅...
wepoke辅助挂!wepow... wepoke辅助挂!wepower有辅助器吗,(WEpoke)其实存在有挂,实用技巧(黑科技助手);...
wepoke计算辅助!wepo... wepoke计算辅助!wepoke辅助软件靠谱吗,(wePOke)确实存在有挂,安装教程(黑科技神器...
aapoker外挂实测!aap... aapoker外挂实测!aapoker透视辅助器,(aApoker)竟然存在有挂,科技教程(黑科技方...
wpkai辅助软件推荐!wpk... wpkai辅助软件推荐!wpk最新黑科技,(WPk)切实真的有挂,透视教程(黑科技软件)小薇(透视辅...