在代码中添加以下权限
同时请检查您的设备是否已启用蓝牙,并且已安装正确版本的蓝牙库。此外,您可以使用以下代码段进行检查:
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (mBluetoothAdapter == null) { // Device does not support Bluetooth } else { // Bluetooth is supported if (!mBluetoothAdapter.isEnabled()) { // Bluetooth is not enabled, prompt the user to turn it on } }
上一篇:AppJar的网格布局操作
下一篇:app监控