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();
试试这个