在我的应用程序中,某些任务需要某种类型的网络连接(无论是wifi还是手机都可以)。在MyActivity,我有onResume()
检查,以检查网络状态,如果没有连接,我想显示网络设置屏幕:在Android上显示所需的设置屏幕
private void showConnectionSettings() {
Intent intent = new Intent(Settings.ACTION_WIRELESS_SETTINGS);
ComponentName cn = new ComponentName("com.android.phone", "com.android.phone.Settings");
intent.setComponent(cn);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
this.getBaseContext().startActivity(intent);
}
然而,这带给我的移动网络屏幕,当我想要显示用户可以选择其连接类型的Wireless and Network Settings
屏幕。
“如果没有连接,*我想*显示网络设置屏幕”?除此之外,我不知道你需要什么。 – Gangnus 2012-02-07 19:25:52
[Android - 从应用打开设置]的可能重复(http://stackoverflow.com/questions/7454416/android-open-settings-from-app) – 2013-07-16 22:16:19