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

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

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

<tfoot id='QSSFN'></tfoot>
      • <bdo id='QSSFN'></bdo><ul id='QSSFN'></ul>
      <legend id='QSSFN'><style id='QSSFN'><dir id='QSSFN'><q id='QSSFN'></q></dir></style></legend>

        Android 后退按鈕和進度對話框

        Android Back Button and Progress Dialog(Android 后退按鈕和進度對話框)
        <tfoot id='F4uSn'></tfoot>
        <i id='F4uSn'><tr id='F4uSn'><dt id='F4uSn'><q id='F4uSn'><span id='F4uSn'><b id='F4uSn'><form id='F4uSn'><ins id='F4uSn'></ins><ul id='F4uSn'></ul><sub id='F4uSn'></sub></form><legend id='F4uSn'></legend><bdo id='F4uSn'><pre id='F4uSn'><center id='F4uSn'></center></pre></bdo></b><th id='F4uSn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='F4uSn'><tfoot id='F4uSn'></tfoot><dl id='F4uSn'><fieldset id='F4uSn'></fieldset></dl></div>
          <legend id='F4uSn'><style id='F4uSn'><dir id='F4uSn'><q id='F4uSn'></q></dir></style></legend>

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

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

                  <tbody id='F4uSn'></tbody>
                  本文介紹了Android 后退按鈕和進度對話框的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我有一個 AsyncTask,它在工作時顯示一個 progressDialog(它從 doInBackground 中調用 runOnUiThread 來顯示進度對話框).

                  I have an AsyncTask that shows a progressDialog whilst working (it calls runOnUiThread from within doInBackground to show the progress dialog).

                  在運行時,我想允許使用后退按鈕取消操作;其他人遇到了這個問題:返回按鈕不起作用,而progressDialog 正在運行

                  Whilst its running I want to allow the use of the back button to cancel the operation; someone else has had this problem: BACK Button is not working ,while progressDialog is running

                  由于什么原因我無法回復該主題,因此不得不開始另一個?!(另一天的另一個問題)

                  For what ever reason I can't reply to that thread, hence having to start another?! (Another question for another day)

                  我和 Sandy 有同樣的想法,但是當 progressDialog 顯示時,這段代碼從未被調用,這是為什么呢?我已經在我的主要活動類中實現了它,progressDialog 是否暫時將前臺焦點從我的類中移開?

                  I had the same idea as Sandy but this code is never called whilst the progressDialog is showing, why is this? I have implemented it inside my main activity class, does the progressDialog take the foreground focus away from my class temporarily?

                  推薦答案

                  首先,您應該從 OnPreExecute 顯示您的對話框,將其隱藏在 OnPostExecute 中,并且 - 如有必要- 通過發布進度修改它.(參見這里)

                  First, you should show your dialog from OnPreExecute, hide it in OnPostExecute, and - if necessary - modify it by publishing progress. (see here)

                  現在回答您的問題:ProgressDialog.show() 可以將 OnCancelListener 作為參數.您應該提供一個在進度對話框實例上調用 cancel() 的方法.

                  Now to your question: ProgressDialog.show() can take a OnCancelListener as an argument. You should provide one that calls cancel() on the progress dialog instance.

                  示例:

                      @Override
                      protected void onPreExecute(){
                          _progressDialog = ProgressDialog.show(
                                  YourActivity.this,
                                  "Title",
                                  "Message",
                                  true,
                                  true,
                                  new DialogInterface.OnCancelListener(){
                                      @Override
                                      public void onCancel(DialogInterface dialog) {
                                          YourTask.this.cancel(true);
                                          finish();
                                      }
                                  }
                          );
                      }
                  

                  其中 _progressDialogYourTaskProgressDialog 成員.

                  where _progressDialog is a ProgressDialog member of YourTask.

                  此類在 API 級別 26 中已棄用.ProgressDialog 是一種模式對話框,它會阻止用戶與應用程序交互.反而使用此類,您應該使用進度指示器,例如ProgressBar,可以嵌入到應用程序的 UI 中.或者,您可以使用通知來通知用戶任務的進度.鏈接

                  This class was deprecated in API level 26. ProgressDialog is a modal dialog, which prevents the user from interacting with the app. Instead of using this class, you should use a progress indicator like ProgressBar, which can be embedded in your app's UI. Alternatively, you can use a notification to inform the user of the task's progress. LINK

                  這篇關于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)

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

                        <tbody id='vQV8I'></tbody>
                        <tfoot id='vQV8I'></tfoot>

                        <i id='vQV8I'><tr id='vQV8I'><dt id='vQV8I'><q id='vQV8I'><span id='vQV8I'><b id='vQV8I'><form id='vQV8I'><ins id='vQV8I'></ins><ul id='vQV8I'></ul><sub id='vQV8I'></sub></form><legend id='vQV8I'></legend><bdo id='vQV8I'><pre id='vQV8I'><center id='vQV8I'></center></pre></bdo></b><th id='vQV8I'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vQV8I'><tfoot id='vQV8I'></tfoot><dl id='vQV8I'><fieldset id='vQV8I'></fieldset></dl></div>
                        • <bdo id='vQV8I'></bdo><ul id='vQV8I'></ul>
                        • <legend id='vQV8I'><style id='vQV8I'><dir id='vQV8I'><q id='vQV8I'></q></dir></style></legend>
                          • 主站蜘蛛池模板: 日韩av视屏| 日韩福利电影 | 午夜精品久久久久99蜜 | 免费精品| 在线成人福利 | 国产精品久久久久无码av | 国产黄色一级片 | 男女黄网站 | 亚洲国产精品一区二区久久 | 夜夜夜操 | www日本高清 | 日本 欧美 三级 高清 视频 | k8久久久一区二区三区 | 国产精品久久久久久久久久不蜜臀 | 少妇精品久久久久久久久久 | 色桃网 | 亚洲一区二区在线 | 久久精品亚洲精品国产欧美 | 亚洲一区二区在线播放 | 久久国产婷婷国产香蕉 | 成人在线观 | 亚洲精品日韩视频 | 99久久精品国产一区二区三区 | 成人在线中文字幕 | 污免费网站| 国产又爽又黄的视频 | 亚洲最大的成人网 | 国产日韩精品久久 | 91在线一区二区 | 亚洲人成网站777色婷婷 | 精品一区二区三区在线观看 | 亚洲国产精品一区二区三区 | 日韩电影免费在线观看中文字幕 | 爱草在线 | 国产视频中文字幕 | 国产精品免费一区二区三区四区 | 亚洲福利网站 | 日本欧美大片 | 九九免费视频 | 欧美日韩精品一区二区 | a a毛片|