4

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);
Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160
inforg
  • 749
  • 2
  • 8
  • 15

2 Answers2

16

It's pretty simple, try this:

Intent settingsIntent = new Intent(android.provider.Settings.ACTION_BLUETOOTH_SETTINGS);
startActivity(settingsIntent);
Brian
  • 7,955
  • 16
  • 66
  • 107
3

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.

abhi
  • 1,412
  • 19
  • 25
  • tried this and doesn't seem to work. [this](https://stackoverflow.com/a/30006768/2293226) other answer suggests it is not possible because that intent [produces no output](https://developer.android.com/reference/android/provider/Settings.html#ACTION_BLUETOOTH_SETTINGS) – g2server Nov 17 '17 at 11:29