久久久久久久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'>

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

                  問題描述

                  我正在嘗試在非 Activity 類中顯示對話框.基本上,我在我的應(yīng)用程序中檢測到一個對象,我想顯示一個對話框然后切換活動.我在我的 logcat 中收到j(luò)ava.lang.RuntimeException:無法在未調(diào)用 Looper.prepare() 的線程內(nèi)創(chuàng)建處理程序".

                  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 應(yīng)該從 UIthread 調(diào)用,所以嘗試使用它,

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

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

                  希望這行得通.

                  這篇關(guān)于在非活動類中顯示進度對話框的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                  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 或網(wǎng)絡(luò)提供商)
                  Get current location during app launch(在應(yīng)用啟動期間獲取當(dāng)前位置)
                  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>
                            主站蜘蛛池模板: 狠狠操电影 | 国产精品国产a级 | www.亚洲区 | 欧美在线国产精品 | 日本a视频 | 亚洲综合色视频在线观看 | 99精品一区| 中国黄色在线视频 | 日本久久网 | 亚洲 一区 | 久久久久久久久久久久久久av | 98久久| 国产黄色精品在线观看 | 人人九九精 | 亚洲男人天堂 | 天天插天天搞 | 91麻豆精品国产91久久久资源速度 | 亚洲精品欧美 | 在线成人免费视频 | 国产精品一区二区三区99 | 国产精品小视频在线观看 | 国产日韩免费视频 | 亚洲乱码一区二区三区在线观看 | 欧美激情精品久久久久 | 精品一区二区三区免费视频 | 精品产国自在拍 | 红桃视频一区二区三区免费 | 欧美一区二区在线播放 | 久久天堂| 亚洲国产精久久久久久久 | 日韩欧美网 | 日韩欧美国产不卡 | 一级做a| 国产毛片久久久久久久久春天 | 免费毛片网站在线观看 | 久久一起草 | 久久99精品久久 | 国产精品视频免费播放 | 国产1区 | 麻豆精品国产免费 | 国产午夜精品久久久久免费视高清 |