久久久久久久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() 在自定義布局對(duì)話框中編輯文本

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

      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() 在自定義布局對(duì)話框中編輯文本的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我在對(duì)話框的自定義布局中有一個(gè) TextView.對(duì)話框即將出現(xiàn)時(shí),必須更改其文本.

                  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"
                          />
                  

                  我用來(lái)設(shè)置文本和顯示對(duì)話框的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);
                  

                  我也試過(guò)這個(gè)代碼.

                   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();
                  

                  但調(diào)用這些方法時(shí)應(yīng)用會(huì)崩潰.

                  but the app would crash when these method is called.

                  但如果我們刪除

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

                  它不會(huì)崩潰.

                  推薦答案

                  嘗試通過(guò)它的父引用訪問(wèn)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);
                  

                  這篇關(guān)于如何使用 setText() 在自定義布局對(duì)話框中編輯文本的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(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(如何檢測(cè)位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                  Get current location during app launch(在應(yīng)用啟動(dòng)期間獲取當(dāng)前位置)
                  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. 主站蜘蛛池模板: 久久国产传媒 | 欧美精品久久久 | 中文字幕中文字幕 | av成年人网站 | 久久久久综合 | 搞黄网站在线观看 | 亚洲区在线 | 嫩草视频网 | 久久久久久久久久久久久久久久久久久久 | 九九九视频在线观看 | 一级黄色片网址 | 91美女在线观看 | 精品久久久久久久久久久下田 | 97超碰人人| 亚欧洲精品在线视频免费观看 | 亚洲日本欧美日韩高观看 | 亚洲午夜在线 | 在线观看中文字幕 | 久久人人网 | 91久久精品一区二区二区 | 欧美日韩久久 | 香蕉一区二区 | 亚洲精品视频免费观看 | 最新毛片网站 | 视频一区二区三区在线观看 | 99精品视频在线观看免费播放 | 精品国产免费一区二区三区演员表 | 欧美中文字幕一区二区三区亚洲 | 美女爽到呻吟久久久久 | 欧美激情亚洲天堂 | 国产欧美在线播放 | 久久久久国产精品人 | 欧美一区二区三区 | 成人福利网 | 国产精品久久久久无码av | 国产精品毛片一区二区三区 | 日韩视频一区 | 一级特黄a大片 | 国产一级在线观看 | 手机看片1 | 视频第一区 |