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

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

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

      1. 在自定義對話框中設置微調器

        Set spinner within custom dialog(在自定義對話框中設置微調器)

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

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

            • <tfoot id='GTdwc'></tfoot>
              <legend id='GTdwc'><style id='GTdwc'><dir id='GTdwc'><q id='GTdwc'></q></dir></style></legend>

                • <small id='GTdwc'></small><noframes id='GTdwc'>

                  本文介紹了在自定義對話框中設置微調器的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在嘗試在對話框中創建 Spinner 時遇到 NullPointerException,并且似乎無法調試它,因為代碼看起來很可靠.想知道其他人是否有任何想法.非常感謝任何幫助.

                  I'm getting a NullPointerException while attempting to create a Spinner within a dialog and can't seem to debug it because the code looks solid. Wonder if anyone else has any idea. Any help is greatly appreciated.

                      protected Dialog onCreateDialog(int id)
                      {
                          Dialog dialog;
                          switch(id) {
                          case DIALOG_SEND_PM:
                              Spinner spinner = (Spinner)findViewById(R.id.pm_server);
                              ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.server_array, android.R.layout.simple_spinner_item);
                              adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                              spinner.setAdapter(adapter);
                              spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
                  
                              dialog = new Dialog(PM.this);
                              dialog.setContentView(R.layout.send_pm_dialog);
                              dialog.setTitle(R.string.send_pm);
                              pmMessage = (EditText) dialog.findViewById(R.id.send_pm_box);
                              Button sendPm = (Button) dialog.findViewById(R.id.send_pm_button);
                              sendPm.setOnClickListener(PM.this);
                              break;
                          default:
                              dialog = null;
                     }
                  

                  我在 adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);我將上下文更改為 MyClass.this 并將異常移至下一行,這讓我感到困惑.我想知道它是否是具有空值的適配器,但我在不在對話框中時以與以前相同的方式調用所有內容.

                  I get the exception at adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); I changed the context to MyClass.this and the exception moved down to the next line, which confuses me. I'm wondering if it is the adapter having a null value but I call everything the same way I have before while not in a dialog.

                  相關的 XML 數據:

                  Relevant XML data:

                  <LinearLayout>
                      <TextView/>
                  
                      <LinearLayout>
                  
                         <TextView/>
                        <EditText/>
                        <TextView/>
                        <Spinner
                          android:id="@+id/pm_server"
                          android:layout_height="fill_parent"
                          android:layout_width="wrap_content"
                          android:background="@drawable/yblueborder"
                          android:textColor="#ABABAB"/>
                      </LinearLayout>
                  
                      <Button/>
                  </LinearLayout>
                  

                  編輯了其余的數據,以免占用太多空間.

                  Edited out the rest of the data so it wouldn't take up too much space.

                  推薦答案

                  我已經設法解決了這個問題.這是非常微妙的,我很確定我很幸運.這是工作代碼:

                  I have managed to fix the issue. It was very subtle and I'm pretty sure I got lucky. Here's the working code:

                  protected Dialog onCreateDialog(int id)
                      {
                          Dialog dialog;
                          switch(id) {
                          case DIALOG_SEND_PM:
                              dialog = new Dialog(PM.this);
                              dialog.setContentView(R.layout.send_pm_dialog);
                              dialog.setTitle(R.string.send_pm);
                              pmMessage = (EditText) dialog.findViewById(R.id.send_pm_box);
                              Button sendPm = (Button) dialog.findViewById(R.id.send_pm_button);
                              sendPm.setOnClickListener(PM.this);
                  
                              Spinner spinner = (Spinner)dialog.findViewById(R.id.pm_server);
                              ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.server_array, android.R.layout.simple_spinner_item);
                              adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
                              spinner.setAdapter(adapter);
                              spinner.setOnItemSelectedListener(new MyOnItemSelectedListener());
                              break;
                          default:
                              dialog = null;
                          }
                          return dialog;
                      }
                  

                  我移動了一些代碼,以便在微調器之前初始化對話框,但這不是問題.我添加了對話框.在 Spinner spinner = (Spinner)dialog.findViewById(R.id.pm_server);這就是訣竅.希望這對其他人有幫助.

                  I moved some of the code around so that the dialog was initialized before the spinner, but that was not the issue. I added dialog. in Spinner spinner = (Spinner)dialog.findViewById(R.id.pm_server); and that did the trick. Hope this helps others.

                  這篇關于在自定義對話框中設置微調器的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                • <small id='gkDwG'></small><noframes id='gkDwG'>

                    <tbody id='gkDwG'></tbody>

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

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

                          • <tfoot id='gkDwG'></tfoot>
                            主站蜘蛛池模板: 国产精品1 | 亚洲aⅴ | 人人九九精 | 亚洲精品大全 | 超碰97免费在线 | 中文无吗 | 国产精品视频免费看 | 在线国产一区 | 欧美激情在线观看一区二区三区 | 激情小视频 | 欧美一级二级视频 | 中文字幕韩在线第一页 | 久久综合久久综合久久综合 | 成人深夜福利 | 午夜国产 | 国产精品18久久久 | 成人毛片视频免费 | 涩爱av一区二区三区 | 久久99久久 | 亚州春色| 日本国产欧美 | 亚洲一区二区三区在线 | 国产精品国产三级国产a | 最新高清无码专区 | 亚洲啊v在线 | 精品欧美一区二区在线观看视频 | 欧美日韩在线一区二区 | 久久精品亚洲精品国产欧美 | 国产成人一区二区三区精 | 国产精品美女www爽爽爽视频 | 99精品国产一区二区青青牛奶 | 一色桃子av一区二区 | 91av在线电影 | 亚洲精品视频免费看 | 高清人人天天夜夜曰狠狠狠狠 | 中文字幕在线观看www | 热re99久久精品国99热观看 | 国产色在线 | 亚洲高清在线观看 | 日韩精品一区二区三区视频播放 | 免费艹逼视频 |