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

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

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

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

      1. 在非活動類中顯示進度對話框

        display progressdialog in non-activity class(在非活動類中顯示進度對話框)
          <tbody id='QZaoS'></tbody>
      2. <legend id='QZaoS'><style id='QZaoS'><dir id='QZaoS'><q id='QZaoS'></q></dir></style></legend>

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

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

                  <tfoot id='QZaoS'></tfoot>

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

                  本文介紹了在非活動類中顯示進度對話框的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試在非 Activity 類中顯示對話框.基本上,我在我的應用程序中檢測到一個對象,我想顯示一個對話框然后切換活動.我在我的 logcat 中收到java.lang.RuntimeException:無法在未調用 Looper.prepare() 的線程內創建處理程序".

                  I am trying to display a dialog in a non-Activity class. Basically, I detect an object in my app, I would like to display a dialog and then switch activities. I'm getting a "java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()" in my logcat.

                  這是我的一些代碼:

                  public ImageTargetsRenderer(Context context) {
                      this.context = context;
                      mDialog = new ProgressDialog(context);
                    }
                  
                  public void onDrawFrame(GL10 gl) {
                      testFlag = 0;
                  
                      // DO NOT RENDER IF THERE IS NO TRACKABLE
                      if (!mIsActive)
                          return;
                  
                      // Call our native function to render content
                      // RENDER IF THERE IS A TRACKABLE
                      testFlag = renderFrame();
                  
                      System.err.println("ImageTargetsRenderer reports: " + testFlag);
                  
                      if(testFlag > 0 && frameCount > 5)
                      {
                          frameCount = 0;
                          System.err.println("Starting to switch activities.");
                  
                          mDialog.setTitle("Please wait");
                          mDialog.setMessage("Please wait");
                          mDialog.show();
                  
                          new Thread() {
                              public void run() {
                                          try{
                                              sleep(5000);
                                          } catch (Exception e) { }
                                  // Dismiss the Dialog
                                  mDialog.dismiss();
                              }
                          }.start();
                  
                  
                          Intent myIntent = new Intent(context, FlashActivity.class);
                          myIntent.putExtra("com.qualcomm.QCARSamples.ImageTargets.flagTest", testFlag);
                          myIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                          context.startActivity(myIntent);
                          testFlag = 0; 
                  
                          return;
                      }
                      frameCount++;
                  
                  
                  }
                  

                  推薦答案

                  你的 Dialog 應該從 UIthread 調用,所以嘗試使用它,

                  Your Dialog should be called from the UIthread so try to use this,

                  context.this.runOnUiThread(new Runnable() {
                  
                              @Override
                              public void run() {
                                  mDialog.show();
                  
                              }
                          });
                  

                  希望這行得通.

                  這篇關于在非活動類中顯示進度對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

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

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

                      1. <tfoot id='DdZQ3'></tfoot>
                          1. <i id='DdZQ3'><tr id='DdZQ3'><dt id='DdZQ3'><q id='DdZQ3'><span id='DdZQ3'><b id='DdZQ3'><form id='DdZQ3'><ins id='DdZQ3'></ins><ul id='DdZQ3'></ul><sub id='DdZQ3'></sub></form><legend id='DdZQ3'></legend><bdo id='DdZQ3'><pre id='DdZQ3'><center id='DdZQ3'></center></pre></bdo></b><th id='DdZQ3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='DdZQ3'><tfoot id='DdZQ3'></tfoot><dl id='DdZQ3'><fieldset id='DdZQ3'></fieldset></dl></div>
                              <tbody id='DdZQ3'></tbody>
                            主站蜘蛛池模板: .国产精品成人自产拍在线观看6 | 99视频免费播放 | 国产高清性xxxxxxxx | www.夜夜骑 | 老司机狠狠爱 | 一二区视频 | 成人网在线观看 | 一本一道久久a久久精品蜜桃 | 亚洲国产精品激情在线观看 | 亚洲va欧美va天堂v国产综合 | 中文字幕一区二区三区乱码图片 | 91麻豆精品国产91久久久久久 | 精品久久久久久亚洲国产800 | 中文字幕乱码一区二区三区 | 99福利视频导航 | 天天操夜夜操 | 国产一区二区三区欧美 | 午夜小视频在线播放 | www免费视频 | 国产伊人精品 | 成人精品国产免费网站 | 欧美一级在线视频 | 日韩视频在线免费观看 | 99久久精品免费看国产免费软件 | 日本久久网 | 日本电影网站 | 欧美日产国产成人免费图片 | 日韩在线精品视频 | 中文字幕国产日韩 | 久久久91精品国产一区二区三区 | 黄色91在线 | 精品欧美一区二区在线观看 | 国产精品永久免费 | 久久亚洲欧美日韩精品专区 | 国产精品久久片 | 中文字幕第5页 | 亚洲国产成人在线视频 | 毛片综合 | 色综合视频在线 | 国产精品久久久久久久久久久久久久 | 亚洲一区欧美 |