久久久久久久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. 主站蜘蛛池模板: 久久er精品 | 玖玖视频网 | 国产中文在线 | 精品视频久久久 | 中文精品一区二区 | 日本黄视频在线观看 | 91在线观 | 久久久久国产精品一区二区 | 在线观看中文字幕一区二区 | 久久久免费精品 | 在线亚洲人成电影网站色www | 中文字幕av在线一二三区 | 精品乱码一区二区 | 狠狠干天天干 | 国产精品日韩 | 可以在线看的黄色网址 | 黄色片免费 | 视频一区在线观看 | 伊人久久国产 | 中文字幕在线免费 | 亚洲精品资源 | 亚洲播放 | 欧美综合精品 | 三级黄色片在线 | 国产精品欧美日韩 | 欧美成人精品一区二区男人看 | 韩国av一区二区 | 黄色一级特级片 | 一级片网址 | 91影院| 成人综合视频在线观看 | 国产精品日韩 | 免费的色网站 | 久久亚洲国产精品 | 神马九九 | 欧美日韩在线一区二区 | 精精国产xxxx视频在线播放 | 夜色www国产精品资源站 | 日韩在线欧美 | 亚洲色欧美另类 | 精品欧美一区二区三区精品久久 |