The application can not be separated from the server network interaction, but there is time in the network information bad time, we have to give users the prompt to make network settings, in our application generally there will be a Network load error (failure) of the page, there is an operation control, click can enter the mobile phone network settings interface, the code is simple:
/**intent Object */
Intent Intent = null;
/** judge the version of the mobile phone system is more than 10 API is 3.0 or more versions and Meizu mobile phone * *
if (Android.os.Build.VERSION.SDK_INT > &&!android.os.build.manufacturer.equals ("Meizu")) {
Intent = new Intent (Android.provider.Settings.ACTION_WIRELESS_SETTINGS);
}
else {
Intent = new Intent ();
ComponentName component = new ComponentName ("Com.android.settings", "Com.android.settings.WirelessSetti NGS ");
Intent.setcomponent (component);
Intent.setaction ("Android.intent.action.VIEW");
}
Context.startactivity (Intent);
The above is used to determine whether the Meizu phone, because we found in the project, the use of the Meizu phone also call the else code in the line.
Android app opens the phone's Network Settings screen