Auto enable bluetooth on android phone [duplicate]
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(Bluetooth开发者_开发百科Adapter.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?
There is no possibility to turn on some phone features like BT, GPS, WiFi without user action. It's android feature introduced in 1.6(?) due to security concerns.
精彩评论