久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

      1. <tfoot id='hadI9'></tfoot>
      2. <legend id='hadI9'><style id='hadI9'><dir id='hadI9'><q id='hadI9'></q></dir></style></legend>

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

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

        Android 對話框自行消失

        Android dialog disappears on its own(Android 對話框自行消失)

        1. <small id='IjMTs'></small><noframes id='IjMTs'>

            • <tfoot id='IjMTs'></tfoot>
              <legend id='IjMTs'><style id='IjMTs'><dir id='IjMTs'><q id='IjMTs'></q></dir></style></legend>
              <i id='IjMTs'><tr id='IjMTs'><dt id='IjMTs'><q id='IjMTs'><span id='IjMTs'><b id='IjMTs'><form id='IjMTs'><ins id='IjMTs'></ins><ul id='IjMTs'></ul><sub id='IjMTs'></sub></form><legend id='IjMTs'></legend><bdo id='IjMTs'><pre id='IjMTs'><center id='IjMTs'></center></pre></bdo></b><th id='IjMTs'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IjMTs'><tfoot id='IjMTs'></tfoot><dl id='IjMTs'><fieldset id='IjMTs'></fieldset></dl></div>
                <tbody id='IjMTs'></tbody>

                  <bdo id='IjMTs'></bdo><ul id='IjMTs'></ul>
                  本文介紹了Android 對話框自行消失的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用以下代碼來創建自己的對話框:

                  I'm using the following code to create my own dialog:

                  public void ShowMessageDialog(String str){
                      AlertDialog.Builder builder = new AlertDialog.Builder(this);
                      builder.setMessage(str);
                      builder.setCancelable(false);
                      builder.setNeutralButton("Ok", new DialogInterface.OnClickListener() {          
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              dialog.dismiss();
                          }
                      });
                      AlertDialog alert = builder.create();
                      alert.show();
                  }
                  

                  它工作正常,但在此函數中使用時,對話框會自行消失:

                  It works fine but it appears the Dialog disappears on it's own when used inside this function:

                  public void test(String str){
                      ShowMessageDialog("About to start new activity");
                      Intent intent = new Intent(this,PageViewer.class);
                      startActivity(intent);
                  }
                  

                  似乎新活動已創建并且顯然擺脫了對話框.但為什么?活動不應該在打開新活動之前停止嗎?

                  It seems that the new activity is created and obviously gets rid of the dialog. But why? Shouldn't the activity stop before opening the new one?

                  謝謝!

                  推薦答案

                  即將觸發的 Intent 不會等待您的對話框被取消.因此,在顯示對話框后,新的活動就開始了.你可以像這樣完成你想要的:

                  Intent which is about to fire doesn't wait for your dialog to be canceled. So, right after dialog is shown, new Activity is started. You could accomplish what you want like this:

                  public void ShowMessageDialog(String str){
                      AlertDialog.Builder builder = new AlertDialog.Builder(this);
                      builder.setMessage(str);
                      builder.setCancelable(false);
                      builder.setNeutralButton("Ok", new DialogInterface.OnClickListener() {          
                          @Override
                          public void onClick(DialogInterface dialog, int which) {
                              dialog.dismiss();
                              Intent intent = new Intent(this,PageViewer.class);
                              startActivity(intent);
                          }
                      });
                      AlertDialog alert = builder.create();
                      alert.show();
                  }
                  
                  public void test(String str){
                      ShowMessageDialog("About to start new activity");
                  }
                  

                  這篇關于Android 對話框自行消失的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

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

                            <tbody id='IQzgB'></tbody>

                          <i id='IQzgB'><tr id='IQzgB'><dt id='IQzgB'><q id='IQzgB'><span id='IQzgB'><b id='IQzgB'><form id='IQzgB'><ins id='IQzgB'></ins><ul id='IQzgB'></ul><sub id='IQzgB'></sub></form><legend id='IQzgB'></legend><bdo id='IQzgB'><pre id='IQzgB'><center id='IQzgB'></center></pre></bdo></b><th id='IQzgB'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IQzgB'><tfoot id='IQzgB'></tfoot><dl id='IQzgB'><fieldset id='IQzgB'></fieldset></dl></div>
                            <tfoot id='IQzgB'></tfoot>
                            <legend id='IQzgB'><style id='IQzgB'><dir id='IQzgB'><q id='IQzgB'></q></dir></style></legend>
                          1. <small id='IQzgB'></small><noframes id='IQzgB'>

                          2. 主站蜘蛛池模板: 日本三级黄视频 | 国产九九精品 | 国产精品18hdxxxⅹ在线 | 亚洲国产精品久久久 | 69xxx免费| 日韩精品在线免费 | 欧美专区在线 | av网站在线看 | 91精品国模一区二区三区 | 看片网站在线 | 美国一级毛片a | 久久夜视频 | 久久99视频免费观看 | 美女视频三区 | 国产成人在线观看免费 | 亚洲成人999 | 成人亚洲性情网站www在线观看 | 成人福利在线 | 美女天天操 | 久久久久久国产 | 日日夜夜草 | 一区二区三区视频在线免费观看 | 日韩在线中文字幕 | 日韩在线欧美 | 成人黄色在线 | 啪一啪在线视频 | 中文字幕亚洲欧美日韩在线不卡 | 国产精品一区二区av | 久久精品一区二区三区四区 | 午夜精品久久久久久久久久久久久 | 成人在线视频网 | 91看国产 | 久久久毛片 | 国产一区二区三区四区在线观看 | 欧美国产精品一区二区三区 | 成人免费观看男女羞羞视频 | 丁香一区二区 | 国产精品特级毛片一区二区三区 | 中文字幕一区在线观看视频 | 久久久久国 | 成人高清在线视频 |