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

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

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

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

      1. <legend id='TRbPl'><style id='TRbPl'><dir id='TRbPl'><q id='TRbPl'></q></dir></style></legend>
      2. Android - java.lang.IllegalArgumentException 在 2.1 和低 a

        Android - java.lang.IllegalArgumentException Erron when creating Dialog on 2.1 and low android(Android - java.lang.IllegalArgumentException 在 2.1 和低 android 上創(chuàng)建對話框時出錯)
      3. <legend id='bS5Jx'><style id='bS5Jx'><dir id='bS5Jx'><q id='bS5Jx'></q></dir></style></legend>

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

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

                <i id='bS5Jx'><tr id='bS5Jx'><dt id='bS5Jx'><q id='bS5Jx'><span id='bS5Jx'><b id='bS5Jx'><form id='bS5Jx'><ins id='bS5Jx'></ins><ul id='bS5Jx'></ul><sub id='bS5Jx'></sub></form><legend id='bS5Jx'></legend><bdo id='bS5Jx'><pre id='bS5Jx'><center id='bS5Jx'></center></pre></bdo></b><th id='bS5Jx'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='bS5Jx'><tfoot id='bS5Jx'></tfoot><dl id='bS5Jx'><fieldset id='bS5Jx'></fieldset></dl></div>
                    <tbody id='bS5Jx'></tbody>
                • <tfoot id='bS5Jx'></tfoot>
                • 本文介紹了Android - java.lang.IllegalArgumentException 在 2.1 和低 android 上創(chuàng)建對話框時出錯的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我從 SDK 版本的手機收到以下錯誤消息 <8. 我剛剛在安卓市場上發(fā)布了這個應(yīng)用程序,在發(fā)布之前我的測試手機是 HTC Thunderbolt 和 Droid X.根本沒有這個問題.

                  I'm getting the below error message from phones that are SDK version < 8. I just released this app on the android market and prior to release my test phones were a HTC Thunderbolt and the Droid X. Neither had this problem at all.

                  我通過 Flurry 收到此錯誤報告.我無法直接對此進行測試,因為我沒有帶有 SDK < 的手機8 并且由于某種原因,我無法讓我的模擬器啟動低于為應(yīng)用程序設(shè)置的默認(rèn) SDK 的版本.

                  I'm getting this error report through Flurry. I'm not able to test this directly because I don't have a phone with SDK < 8 and for some reason I can't get my emulator to start a lower version than the default SDK set for an app.

                  java.lang.IllegalArgumentException, android.app.Activity.createDialog:880 -(Activity#onCreateDialog 沒有為 id 1 創(chuàng)建對話框)

                  java.lang.IllegalArgumentException, android.app.Activity.createDialog:880 - (Activity#onCreateDialog did not create a dialog for id 1)

                  下面是我實現(xiàn)的 onCreateDialog(int id).

                  Below is the onCreateDialog(int id) that i've implemented.

                  @Override
                  protected Dialog onCreateDialog(int id) {
                      super.onCreateDialog(id);
                      Dialog dialog = null;
                  
                      switch(id){
                      case 1:
                          dialog = new CustomCalcDialog(this);
                          dialog.setTitle("Enter Shipping %");
                          activeTextView = shippingPercent;
                          dialog.show();
                          dialog = null;
                          break;
                      case 2:
                          dialog = new CustomCalcDialog(this);
                          dialog.setTitle("Enter Tax Rate");
                          activeTextView = taxPercent;
                          dialog.show();
                          dialog = null;
                          break;
                      case 3:
                          dialog = new CustomCalcDialog(this);
                          dialog.setTitle("Enter Commission %");
                          activeTextView = commissionPercent;
                          dialog.show();
                          dialog = null;
                          break;
                      case 4:
                          dialog = new CustomCalcDialog(this);
                          dialog.setTitle("Calculate Subtotal");
                          activeTextView = productSubtotal;
                          dialog.show();
                          dialog = null;
                          break;
                      case 5:
                          dialog = new CustomCalcDialog(this);
                          dialog.setTitle("Additional Shipping");
                          activeTextView = addShipping;
                          dialog.show();
                          dialog = null;
                          break;
                      case 6:
                          dialog = new BackgroundOptionsDialog(this);
                          dialog.setTitle("Choose Background:");
                          dialog.show();
                          dialog = null;
                          break;
                      default:
                          dialog = null;
                      }
                      return dialog;
                  }
                  

                  下面是關(guān)閉對話框的方式.

                  And below is how the Dialog is being dismissed.

                  private void registerListeners () {
                  
                          enterTotal.setOnClickListener(new View.OnClickListener() {
                  
                              @Override
                              public void onClick(View v) {
                                  try {
                                      calcLogic(EQUALS);
                                  }catch(Exception ex){}
                                  operatorChange = DONT_CHANGE;
                  
                                  activeTextView.setText(calcDialogDisplay.getText().toString());
                  
                                  try {
                                      if ((Float.parseFloat(calcDialogDisplay.getText().toString())) < 0) {}
                                  }catch(Exception ex) {
                                      activeTextView.setText("0");
                                  }
                                  mathCalculations();
                                  CustomCalcDialog.this.dismiss();
                              }
                          });
                  

                  推薦答案

                  也遇到了這個問題,用下面的方法解決了:

                  Had the problem also and solved it with the following:

                  -不要在方法中返回空對話框:protected Dialog onCreateDialog(int id)

                  -Don't return a null Dialog in method: protected Dialog onCreateDialog(int id)

                  在 Android 2.1 中的 Activity.java 中,第 871 行引發(fā)了錯誤.

                  In Android 2.1 in Activity.java the error was raised on line 871.

                  private Dialog createDialog(Integer dialogId, Bundle state) {
                  869         final Dialog dialog = onCreateDialog(dialogId);
                  870         if (dialog == null) {
                  871             throw new IllegalArgumentException("Activity#onCreateDialog did "
                  872                     + "not create a dialog for id " + dialogId);
                  873         }
                  874         dialog.dispatchOnCreate(state);
                  875         return dialog;
                  876     }
                  

                  如果您在以后的 Android 中查看,則會檢查空 Dialog,并且它會返回并處理.所以在這里它起作用了.

                  If you look in later Android there is a check for a null Dialog and it's handeld with a return. So here it works.

                  -不要使用 Bundle(在 API8 中更改):

                  -Don't use Bundle (changed in API8):

                  受保護的對話框 onCreateDialog(int id, Bundle bundle);

                  protected Dialog onCreateDialog(int id, Bundle bundle);

                  使用:

                  受保護的對話框 onCreateDialog(int id);

                  protected Dialog onCreateDialog(int id);

                  -我還使用了以下檢查(有一個帶有自定義對話框的特殊情況):

                  -I also used the following check (had a special case with a custom dialog):

                      if(Build.VERSION.SDK_INT <= Build.VERSION_CODES.ECLAIR_MR1) {
                          return dialog;
                      } else {
                          return null;
                      }
                  

                  也許它可以幫助某人......

                  Maybe it helps someone...

                  這篇關(guān)于Android - java.lang.IllegalArgumentException 在 2.1 和低 android 上創(chuàng)建對話框時出錯的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

                • <small id='5PBlf'></small><noframes id='5PBlf'>

                    <tbody id='5PBlf'></tbody>

                      <legend id='5PBlf'><style id='5PBlf'><dir id='5PBlf'><q id='5PBlf'></q></dir></style></legend>

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

                          • <bdo id='5PBlf'></bdo><ul id='5PBlf'></ul>
                          • 主站蜘蛛池模板: 视频一区二区国产 | 毛片一区二区三区 | 毛片网在线观看 | a级黄色片在线观看 | 天天看天天干 | 久久久精品一区二区三区 | 91免费观看| 天天色综 | 成人欧美一区二区三区黑人孕妇 | 免费亚洲成人 | 99热这里有精品 | 欧美vide| 一级片在线视频 | 99久久精品一区二区毛片吞精 | 中文字幕一区二区三区乱码图片 | 久久久久久成人 | 色爱区综合 | 午夜一区| 欧美一区视频 | 91视频在线| 激情国产在线 | 国产高清一区二区三区 | 国产精品综合 | 亚州成人| 欧美成人a | 日韩欧美手机在线 | 一区二区视频在线观看 | 一区免费视频 | 日韩精品一区二区三区视频播放 | 久久天堂网 | 日本涩涩网 | 亚洲国产精品99久久久久久久久 | 亚洲三级av | 日韩欧美亚洲 | 午夜国产 | 电影午夜精品一区二区三区 | 日韩精品视频一区二区三区 | 国产91在线播放精品91 | 少妇精品久久久久久久久久 | 三级成人在线观看 | 午夜在线视频 |