<i id='f8sBm'><tr id='f8sBm'><dt id='f8sBm'><q id='f8sBm'><span id='f8sBm'><b id='f8sBm'><form id='f8sBm'><ins id='f8sBm'></ins><ul id='f8sBm'></ul><sub id='f8sBm'></sub></form><legend id='f8sBm'></legend><bdo id='f8sBm'><pre id='f8sBm'><center id='f8sBm'></center></pre></bdo></b><th id='f8sBm'></th></span></q></dt></tr></i><div id='f8sBm'><tfoot id='f8sBm'></tfoot><dl id='f8sBm'><fieldset id='f8sBm'></fieldset></dl></div>

    • <bdo id='f8sBm'></bdo><ul id='f8sBm'></ul>

      <legend id='f8sBm'><style id='f8sBm'><dir id='f8sBm'><q id='f8sBm'></q></dir></style></legend>

      1. <tfoot id='f8sBm'></tfoot>
      2. <small id='f8sBm'></small><noframes id='f8sBm'>

      3. 为什么 setCanceledOnTouchOutside(false) 在警报生成器中

        时间:2023-08-30

        <i id='t2Bek'><tr id='t2Bek'><dt id='t2Bek'><q id='t2Bek'><span id='t2Bek'><b id='t2Bek'><form id='t2Bek'><ins id='t2Bek'></ins><ul id='t2Bek'></ul><sub id='t2Bek'></sub></form><legend id='t2Bek'></legend><bdo id='t2Bek'><pre id='t2Bek'><center id='t2Bek'></center></pre></bdo></b><th id='t2Bek'></th></span></q></dt></tr></i><div id='t2Bek'><tfoot id='t2Bek'></tfoot><dl id='t2Bek'><fieldset id='t2Bek'></fieldset></dl></div>
        1. <tfoot id='t2Bek'></tfoot>

          • <bdo id='t2Bek'></bdo><ul id='t2Bek'></ul>

            <small id='t2Bek'></small><noframes id='t2Bek'>

              <tbody id='t2Bek'></tbody>
            <legend id='t2Bek'><style id='t2Bek'><dir id='t2Bek'><q id='t2Bek'></q></dir></style></legend>

                  本文介绍了为什么 setCanceledOnTouchOutside(false) 在警报生成器中不起作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我的活动中有一个警报对话框,不希望用户通过单击对话框外部来关闭它.根据我的研究(like this),我发现了 setCanceledOnTouchOutside(false); 方法.但是,我无法在我的应用程序中使用它,并且可以在使用此方法时关闭对话框.

                  I have an alert dialog in my activity and don't want user can dismiss it by clicking outside of the dialog. Based on my research (like this) I found setCanceledOnTouchOutside(false); method. However, I couldn't use it in my application and it is possible to dismiss dialog while I have this method.

                  这是我的代码:

                  private AlertDialog alertDialog;
                  alertDialog = new AlertDialog.Builder(this).create();
                  alertDialog.setCanceledOnTouchOutside(false);
                  alertDialog.setTitle("");
                  alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK", new DialogInterface.OnClickListener() {
                  public void onClick(DialogInterface dialog, int which) {
                          switch (intAlertAction) {
                              case 1:
                              case 2:
                              case 3:
                              default:
                          }
                  }
                  });
                  

                  任何建议将不胜感激.

                  推荐答案

                  这是一个有趣的问题,我想我知道你的答案.

                  This is an interesting question and I think I know your answer.

                  我一直在不同平台上测试应用程序,我注意到它们之间存在细微差别.在 android 4.0 以上,当您触摸 Toast 消息时,它就会消失.我想对话框(和 AlertDialogs)也是如此.触摸时它只是消失"(但它不会消失!-只是看不到).

                  I have been testing an application on different platforms and I noticed a small difference between them. Above android 4.0 when you touch a Toast message, it simply disappears. I guess it is the same with dialogs (and AlertDialogs). It simply "disappears" when touching (but it is not dismissed! - just cannot be seen).

                  希望对您有所帮助!

                  这篇关于为什么 setCanceledOnTouchOutside(false) 在警报生成器中不起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:为每个对话框更改对话框主题 下一篇:如何更改 ListPreference 对话框的外观

                  相关文章

                  最新文章

                      <bdo id='vPbsW'></bdo><ul id='vPbsW'></ul>

                    <tfoot id='vPbsW'></tfoot>

                    <small id='vPbsW'></small><noframes id='vPbsW'>

                    1. <legend id='vPbsW'><style id='vPbsW'><dir id='vPbsW'><q id='vPbsW'></q></dir></style></legend>
                    2. <i id='vPbsW'><tr id='vPbsW'><dt id='vPbsW'><q id='vPbsW'><span id='vPbsW'><b id='vPbsW'><form id='vPbsW'><ins id='vPbsW'></ins><ul id='vPbsW'></ul><sub id='vPbsW'></sub></form><legend id='vPbsW'></legend><bdo id='vPbsW'><pre id='vPbsW'><center id='vPbsW'></center></pre></bdo></b><th id='vPbsW'></th></span></q></dt></tr></i><div id='vPbsW'><tfoot id='vPbsW'></tfoot><dl id='vPbsW'><fieldset id='vPbsW'></fieldset></dl></div>