Android 如何直接在无线&;上启动设置;网络页面?
我将要建立自己的对话框来通知用户应用程序没有进入互联网,我计划在上面设置两个按钮。设置,然后取消,就像在许多其他应用程序中看到的那样Android 如何直接在无线&;上启动设置;网络页面?,android,Android,我将要建立自己的对话框来通知用户应用程序没有进入互联网,我计划在上面设置两个按钮。设置,然后取消,就像在许多其他应用程序中看到的那样 我现在想知道,如何直接在无线和网络页面上启动设置?这真的非常有用,我也实现了与您相同的设置。但你还是能帮我解决一下吗: /** * Display a dialog that user has no internet connection * @param ctx1 * * Code from: http://osdir.c
我现在想知道,如何直接在无线和网络页面上启动设置?这真的非常有用,我也实现了与您相同的设置。但你还是能帮我解决一下吗:
/**
* Display a dialog that user has no internet connection
* @param ctx1
*
* Code from: http://osdir.com/ml/Android-Developers/2009-11/msg05044.html
*/
public static void showNoConnectionDialog(Context ctx1) {
final Context ctx = ctx1;
AlertDialog.Builder builder = new AlertDialog.Builder(ctx);
builder.setCancelable(true);
builder.setMessage(R.string.no_connection);
builder.setTitle(R.string.no_connection_title);
builder.setPositiveButton(R.string.settings, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
ctx.startActivity(new Intent(Settings.ACTION_WIRELESS_SETTINGS));
}
});
builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
return;
}
});
builder.setOnCancelListener(new DialogInterface.OnCancelListener() {
public void onCancel(DialogInterface dialog) {
return;
}
});
builder.show();
}