久久久久久久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 上單擊“確定"?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

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

                  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.

                  推薦答案

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

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

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

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

                  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 中實現(xiàn) onPositiveButtonClicked().您可以調(diào)用 onPositiveButtonClicked()dismissDialog(id),而不是以編程方式單擊 OK 按鈕.如果您需要處理多個對話框,請讓 onPositiveButtonClicked 采用 id 參數(shù).

                  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.

                  這篇關(guān)于如何通過代碼在 AlertDialog 上單擊“確定"?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 獲取用戶的當前位置)
                  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)用啟動期間獲取當前位置)
                  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>
                          • 主站蜘蛛池模板: 成人福利视频 | 亚洲精品电影网在线观看 | 91精品国产手机 | 在线欧美 | 日本久草视频 | 国产99久久精品一区二区300 | 欧美黄色小视频 | 国产激情亚洲 | 免费在线观看黄视频 | 91精品久久久久久久久中文字幕 | 日韩中文一区二区三区 | 97精品超碰一区二区三区 | 欧美黄在线观看 | 久久久久久99 | 日韩在线免费看 | 成人在线欧美 | 亚洲 日本 欧美 中文幕 | 久久国产精品网站 | 欧美日本一区二区 | 免费av手机在线观看 | 中文字幕免费在线 | 永久www成人看片 | 成人伊人 | av中文在线 | 一区亚洲| 精品美女视频在线观看免费软件 | 日韩在线中文 | 国产欧美一区二区三区另类精品 | 二区在线视频 | 国产精品一区二区三区久久 | 精品一区二区三区在线观看国产 | 久久久久香蕉视频 | 伊人伊人| 五月天综合影院 | 色香婷婷 | 国产成人在线播放 | 视频一二三区 | 欧美成人激情 | 国产精品99久久久久久大便 | 99re6在线| 第一福利社区1024 |