【问题标题】:Mobile application how to prevent the confirm box is not closed when i clicked outside this dialog当我在此对话框外单击时,移动应用程序如何防止确认框未关闭
【发布时间】:2017-03-10 08:46:38
【问题描述】:

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

var message = text;
var title = "INFO";
var buttonLabels = "OK";
navigator.notification.confirm(message, null, title, buttonLabels);

有人可以在移动应用程序中解释当我在此对话框之外单击时如何关闭上述对话框吗?

只有当我点击确定按钮时它才会关闭。

【问题讨论】:

    标签: javascript android jquery


    【解决方案1】:
        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();
    

    试试这个..

    【讨论】:

      猜你喜欢
      • 2018-02-20
      • 1970-01-01
      • 1970-01-01
      • 2022-01-06
      • 2022-09-26
      • 2016-11-12
      相关资源
      最近更新 更多