Skip to content Skip to sidebar Skip to footer

Open Wireless Settings From App

I want to open the Settings-> Wireless & networks directly from my application. How can I do that?

Solution 1:

Try this:

startActivity(new Intent(android.provider.Settings.ACTION_WIRELESS_SETTINGS));

Or perhaps startActivityForResult. Your call. You can open different settings by checking the constants in Settings

Solution 2:

You can access the WiFi settings directly using this:

Intentintent=newIntent(Intent.ACTION_MAIN);
intent.setClassName("com.android.settings", "com.android.settings.wifi.WifiSettings");
startActivity(intent);

The above did not work on Android 3.0, so I ended up using:

Intentintent=newIntent(Settings.ACTION_WIRELESS_SETTINGS);
startActivity(intent);

Solution 3:

Solution 4:

use the below code to call wireless and networks directly from your application.

Intent intent=newIntent();
            intent.setComponent(newComponentName("com.android.settings", "com.android.settings.WirelessSettings"));
            startActivity(intent);

Solution 5:

Use Following Function For Open WI_FI Settings

privatevoidopenWifi() {
    Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
    startActivity(intent);
}

Post a Comment for "Open Wireless Settings From App"