【发布时间】:2012-10-19 09:50:13
【问题描述】:
可能重复:
How to enable/disable bluetooth programmatically in android
您好,我正在开发一个必须以编程方式打开蓝牙的应用程序,请您告诉我如何一步一步地执行此操作,谢谢
【问题讨论】:
-
你搜索过这个问题吗?
可能重复:
How to enable/disable bluetooth programmatically in android
您好,我正在开发一个必须以编程方式打开蓝牙的应用程序,请您告诉我如何一步一步地执行此操作,谢谢
【问题讨论】:
此代码对我有用。你可以试试这个
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (!mBluetoothAdapter.isEnabled()) {
//Play with bluetooth
}else{
mBluetoothAdapter.disable();
}
【讨论】: