Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 移动应用程序如何防止我在此对话框外单击时确认框未关闭_Javascript_Android_Jquery - Fatal编程技术网

Javascript 移动应用程序如何防止我在此对话框外单击时确认框未关闭

Javascript 移动应用程序如何防止我在此对话框外单击时确认框未关闭,javascript,android,jquery,Javascript,Android,Jquery,您能解释一下我们将如何使用下面的代码吗?因为我们没有对话框: var message = text; var title = "INFO"; var buttonLabels = "OK"; navigator.notification.confirm(message, null, title, buttonLabels); 有人能在移动应用程序中解释当我在这个对话框外单击时如何关闭上面的对话框吗 当我点击OK按钮时它才关闭 new AlertDialog.Builder(this)

您能解释一下我们将如何使用下面的代码吗?因为我们没有对话框:

var message = text;
var title = "INFO";
var buttonLabels = "OK";
navigator.notification.confirm(message, null, title, buttonLabels);
有人能在移动应用程序中解释当我在这个对话框外单击时如何关闭上面的对话框吗

当我点击OK按钮时它才关闭

    new AlertDialog.Builder(this)
            .setTitle(Your Title)
            .setMessage(Your Message)
            .setCancelable(true)
            .setPositiveButton("Yes", new DialogInterface.OnClickListener()
        {
            @Override
            public void onClick(DialogInterface dialog, int which) {
                //Action to be performed on click  `
            }

        })
        .setNegativeButton("No", null)//Keep If you want to
        .show();
试试这个