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

    <bdo id='1EllW'></bdo><ul id='1EllW'></ul>
      <legend id='1EllW'><style id='1EllW'><dir id='1EllW'><q id='1EllW'></q></dir></style></legend>

      <small id='1EllW'></small><noframes id='1EllW'>

      <tfoot id='1EllW'></tfoot>

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

        如何使用 setText() 在自定義布局對話框中編輯文本

        How to use setText() to edit text in custom layout dialog(如何使用 setText() 在自定義布局對話框中編輯文本)

      1. <tfoot id='ujqXd'></tfoot>
        • <legend id='ujqXd'><style id='ujqXd'><dir id='ujqXd'><q id='ujqXd'></q></dir></style></legend>

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

              <tbody id='ujqXd'></tbody>

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

                  本文介紹了如何使用 setText() 在自定義布局對話框中編輯文本的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在對話框的自定義布局中有一個 TextView.對話框即將出現時,必須更改其文本.

                  I have a TextView in a custom layout for dialog. Its text has to be changed when the dialog is about to appear.

                        <TextView
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:id="@+id/final_score"
                          />
                  

                  我用來設置文本和顯示對話框的java代碼是

                  java code I used to set text and show dialog is

                  AlertDialog.Builder builder = new AlertDialog.Builder(this);
                      LayoutInflater inflater = this.getLayoutInflater();
                      builder.setView(inflater.inflate(R.layout.its_over, null));
                      AlertDialog dialog = builder.create();
                      dialog.show();
                      TextView t = (TextView)findViewById(R.id.final_score);
                      t.setText(""+score);
                  

                  我也試過這個代碼.

                   AlertDialog.Builder builder = new AlertDialog.Builder(this);
                      LayoutInflater inflater = this.getLayoutInflater();
                      builder.setView(inflater.inflate(R.layout.its_over, null));
                      AlertDialog dialog = builder.create();
                      TextView t = (TextView)dialog.findViewById(R.id.final_score);
                      t.setText(""+score);
                      dialog.show();
                  

                  但調用這些方法時應用會崩潰.

                  but the app would crash when these method is called.

                  但如果我們刪除

                  TextView t = (TextView)dialog.findViewById(R.id.final_score);
                      t.setText(""+score);
                  

                  它不會崩潰.

                  推薦答案

                  嘗試通過它的父引用訪問TextView

                  Try to access the TextView by it's parent referance

                  View view = inflater.inflate(R.layout.its_over, null);
                  builder.setView(view);
                  TextView t = (TextView) view.findViewById(R.id.final_score);
                  

                  這篇關于如何使用 setText() 在自定義布局對話框中編輯文本的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)
                  • <bdo id='Piokz'></bdo><ul id='Piokz'></ul>
                          <tbody id='Piokz'></tbody>

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

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

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

                          2. 主站蜘蛛池模板: 久久久久久久久久久福利观看 | 午夜影院在线观看 | 不卡在线视频 | 天天综合国产 | 欧美精品一区二区三区四区 在线 | 国产精品视频免费 | 婷婷色在线播放 | 日韩精品视频一区二区三区 | 中文字幕免费视频 | 日韩1区| 操一草 | 亚洲国产欧美在线 | 国产a级毛毛片 | 欧美亚洲国语精品一区二区 | 欧美日韩亚洲在线 | 亚洲精品一级 | 蜜桃视频一区二区三区 | 亚洲视频中文字幕 | 另类视频在线 | 99热精品国产 | 婷婷桃色网 | 一区二区中文字幕 | 爱爱视频在线观看 | 午夜视频在线观看网站 | 亚洲欧美一区二区三区在线 | 特级a欧美做爰片毛片 | 日本韩国欧美在线观看 | 男女免费网站 | 九九热在线观看视频 | 亚洲精品成人在线 | 亚洲精品一二三 | 国产精品久久久久久久久久 | 成人在线看片 | 国产在线视频在线观看 | 久久av一区 | 日韩高清av| 欧美日韩成人影院 | 亚洲午夜精品一区二区三区他趣 | 日韩视频在线播放 | 365夜爽爽欧美性午夜免费视频 | 久久久久久久国产精品影院 |