Getting the Bluetooth settings Connect & pair screen using intent?
I want to navigate directly to the bluetooth settings Connect & pair screen on a button click now I can navigate till the wireless settings..
My code is as开发者_如何学编程 follows:
Intent i=new Intent();
i.setClassName("com.android.settings","com.android.settings.WirelessSettings");
startActivity(i);
It's pretty simple, try this:
Intent settingsIntent = new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
startActivity(settingsIntent);
Use the follwoing:
Intent settings_intent = new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
startActivityForResult(settings_intent, 0);
This way you will open Bluetooth settings page and later return back to your activity that started the Intent.
精彩评论