Possible Duplicate:
How to enable/disable bluetooth programmatically in android
I'm trying to write an App that will turn Bluetooth on to scan for devices and connect to a specific device, if it is in range. My problem is how do I turn the Bluetooth on if it is off? If I use :
if (!mBluetoothAdapter.isEnabled()) {
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableBtIntent, REQUEST_ENABLE_BT);
}
there is still a question for the user if he wants to turn the Bluetooth on. Can I turn if on programmatically without the users involvement?