公告
财富商城
积分规则
提问
发文
2019-01-31 00:47发布
家丑人穷心不美
I want to open the Settings-> Wireless & networks directly from my application.
How can I do that?
Use Following Function For Open WI_FI Settings
private void openWifi() { Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS); startActivity(intent); }
That code works for me.
startActivity(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS));
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
You can access the WiFi settings directly using this:
Intent intent = new Intent(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:
Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS); startActivity(intent);
use the below code to call wireless and networks directly from your application.
Intent intent=new Intent(); intent.setComponent(new ComponentName("com.android.settings", "com.android.settings.WirelessSettings")); startActivity(intent);
最多设置5个标签!
Use Following Function For Open WI_FI Settings
That code works for me.
startActivity(new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS));
Try this:
Or perhaps startActivityForResult. Your call. You can open different settings by checking the constants in Settings
You can access the WiFi settings directly using this:
The above did not work on Android 3.0, so I ended up using:
use the below code to call wireless and networks directly from your application.