-1
可能重複:
How to enable/disable bluetooth programmatically in android自動Android手機上啓用藍牙
我試圖寫一個應用程序,將開啓藍牙掃描設備,並連接到特定的設備,如果它在範圍內。 我的問題是如何關閉藍牙功能? 如果我使用:
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
還有很大的,如果他想要打開藍牙的用戶的問題。 如果在沒有用戶參與的情況下以編程方式打開,我可以打開嗎?
請檢查以下鏈接http://stackoverflow.com/questions/3806536/how-to-enable-disable-bluetooth-programmatically-in-android – Nikhil