可能重复:
How to enable/disable bluetooth programmatically in android
您好我正在开发一个以编程方式打开蓝牙的应用程序,请您提前告诉我如何逐步完成该操作
答案 0 :(得分:3)
此代码适用于我。你可以试试这个
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (!mBluetoothAdapter.isEnabled()) {
//Play with bluetooth
}else{
mBluetoothAdapter.disable();
}