有什么方法可以检查设备是否具有蓝牙适配器?
我有一台没有蓝牙的平板电脑。那我该如何处理呢?
最佳答案
向 list 添加权限
<manifest ... >
<uses-permission android:name="android.permission.BLUETOOTH" />
...
</manifest>
Activity 代码
BluetoothAdapter bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (bluetoothAdapter == null) {
//handle the case where device doesn't support Bluetooth
}
else
{
//bluetooth supported
}
关于Android检查设备上是否存在蓝牙,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26235496/