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

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

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

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

  • <i id='SxcVd'><tr id='SxcVd'><dt id='SxcVd'><q id='SxcVd'><span id='SxcVd'><b id='SxcVd'><form id='SxcVd'><ins id='SxcVd'></ins><ul id='SxcVd'></ul><sub id='SxcVd'></sub></form><legend id='SxcVd'></legend><bdo id='SxcVd'><pre id='SxcVd'><center id='SxcVd'></center></pre></bdo></b><th id='SxcVd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='SxcVd'><tfoot id='SxcVd'></tfoot><dl id='SxcVd'><fieldset id='SxcVd'></fieldset></dl></div>
        <tfoot id='SxcVd'></tfoot>
      1. 如何通過代碼在 AlertDialog 上單擊“確定"?

        How to click #39;OK#39; on an AlertDialog via code?(如何通過代碼在 AlertDialog 上單擊“確定?)
        <tfoot id='Pb00d'></tfoot>

            <tbody id='Pb00d'></tbody>

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

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

                  本文介紹了如何通過代碼在 AlertDialog 上單擊“確定"?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在活動中使用 showDialogdismissDialog 來顯示和銷毀我的對話框.還有沒有辦法在當前顯示的對話框上發出點擊命令,而不保留引用對話框的變量?

                  I use showDialog and dismissDialog in activity to display and destroy my dialog. Is there also a way to issue a click command on the currently displayed dialog without keeping a variable referencing the dialog?

                  例如,我想通過代碼按下對話框的確定"/肯定按鈕.

                  For example, I want to press the 'Ok' / positive button of the dialog via code.

                  推薦答案

                  我沒有測試過這段代碼,但它應該可以工作:

                  I haven't tested this code but it should work:

                  AlertDialog dialog = ...
                  dialog.getButton(DialogInterface.BUTTON_POSITIVE).performClick();
                  

                  或者,如果您不想保留對對話框的引用但可以控制其設置,則可以將點擊代碼提取到另一個方法中:

                  Alternatively, if you don't want to keep a reference to the dialog but are in control of its setup, you could extract the on click code into another method:

                  AlertDialog.Builder builder = ...
                  builder.setPositiveButton("OK", new DialogInterface.OnClickListener() {
                    public void onClick(DialogInterface dialog, int which) {
                      onPositiveButtonClicked(); 
                    }
                  });
                  

                  并在您的 Activity 中實現 onPositiveButtonClicked().您可以調用 onPositiveButtonClicked()dismissDialog(id),而不是以編程方式單擊 OK 按鈕.如果您需要處理多個對話框,請讓 onPositiveButtonClicked 采用 id 參數.

                  and implement onPositiveButtonClicked() in your Activity. Instead of programatically clicking the OK button you can call onPositiveButtonClicked() and dismissDialog(id). If you need to handle multiple dialogs, have onPositiveButtonClicked take an id parameter.

                  這篇關于如何通過代碼在 AlertDialog 上單擊“確定"?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

                  <tfoot id='K755i'></tfoot>
                  • <small id='K755i'></small><noframes id='K755i'>

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

                          <legend id='K755i'><style id='K755i'><dir id='K755i'><q id='K755i'></q></dir></style></legend>
                            <i id='K755i'><tr id='K755i'><dt id='K755i'><q id='K755i'><span id='K755i'><b id='K755i'><form id='K755i'><ins id='K755i'></ins><ul id='K755i'></ul><sub id='K755i'></sub></form><legend id='K755i'></legend><bdo id='K755i'><pre id='K755i'><center id='K755i'></center></pre></bdo></b><th id='K755i'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='K755i'><tfoot id='K755i'></tfoot><dl id='K755i'><fieldset id='K755i'></fieldset></dl></div>
                              <tbody id='K755i'></tbody>
                          • 主站蜘蛛池模板: 国产精品久久久久久久久久久久 | 日韩蜜桃视频 | 国产精品久久久久一区二区三区 | 在线观看视频一区二区三区 | 亚洲一区二区在线视频 | 男人的天堂在线视频 | 欧美xxxx色视频在线观看免费 | 欧美亚州综合 | 欧美日韩一区二区在线 | 天堂一区 | 夜夜骑综合 | 黑人久久 | 一区二区三区视频在线观看 | 亚洲日本一区二区 | 三级av网址 | 国产黄色在线观看 | 欧美国产91 | 欧美成人在线免费 | 国产精品久久久久久久午夜片 | 国产激情一区二区三区 | 国产精品1区 | 91在线精品视频 | 日韩在线视频免费观看 | 国产午夜三级一区二区三 | 精品免费 | 亚洲aⅴ一区二区 | 国产激情毛片 | 国产成人在线播放 | 国产午夜久久久 | 91精品国产91久久久久久 | 最新中文字幕第一页视频 | 久久精品在线免费视频 | 免费一区二区三区 | 国产在线第一页 | 有码在线| 亚洲第一天堂无码专区 | 国产精品乱码一区二区三区 | 天天综合日日夜夜 | 国产精品福利在线 | 国产1区| 日本成人免费观看 |