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

<legend id='0nVCX'><style id='0nVCX'><dir id='0nVCX'><q id='0nVCX'></q></dir></style></legend>

<small id='0nVCX'></small><noframes id='0nVCX'>

    <tfoot id='0nVCX'></tfoot>

    • <bdo id='0nVCX'></bdo><ul id='0nVCX'></ul>
    1. <i id='0nVCX'><tr id='0nVCX'><dt id='0nVCX'><q id='0nVCX'><span id='0nVCX'><b id='0nVCX'><form id='0nVCX'><ins id='0nVCX'></ins><ul id='0nVCX'></ul><sub id='0nVCX'></sub></form><legend id='0nVCX'></legend><bdo id='0nVCX'><pre id='0nVCX'><center id='0nVCX'></center></pre></bdo></b><th id='0nVCX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='0nVCX'><tfoot id='0nVCX'></tfoot><dl id='0nVCX'><fieldset id='0nVCX'></fieldset></dl></div>
    2. 點擊 Android 對話框外部以將其關閉?

      Tap outside Android dialog to dismiss it?(點擊 Android 對話框外部以將其關閉?)

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

              <tfoot id='hsWUB'></tfoot>
            1. <small id='hsWUB'></small><noframes id='hsWUB'>

                <tbody id='hsWUB'></tbody>
                本文介紹了點擊 Android 對話框外部以將其關閉?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我想知道是否有可能以某種方式在彈出對話框(或具有對話框主題的 Activity)外部點擊,然后通過點擊它外部將其關閉?

                I was wondering if it's possible to somehow tap outside a popup dialog (or an Activity with a dialog theme), and dismiss it by just tapping outside of it?

                我做了一張快速的圖片來說明它:

                I made a quick picture to illustrate it:

                通常情況下,您必須按返回鍵才能關閉對話框,但在 Honeycomb 上,由于所有屏幕空間,選擇只在對話框外點擊可能會很棒.

                Normally, you have to press the back key to dismiss the dialogs, but on Honeycomb it could be great to have the option of just tapping outside the dialog, due to all the screen estate.

                推薦答案

                我的應用是一個帶有 Theme.Holo.Dialog 的單一活動.就我而言,另一個答案不起作用.它只讓其他后臺應用程序或啟動屏幕接收觸摸事件.

                My app is a single activity with Theme.Holo.Dialog. In my case the other answer did not work. It only made the other background apps or the launch screen to receive touch events.

                我發現使用 dispatchTouchEvent 在我的情況下有效.我認為這也是一個更簡單的解決方案.下面是一些示例代碼,說明如何使用它來檢測帶有 Dialog 主題的 Activity 之外的點擊:

                I found that using dispatchTouchEvent works in my case. I think it is also a simpler solution. Here's some sample code on how to use it to detect taps outside the activity with a Dialog theme:

                @Override
                public boolean dispatchTouchEvent(MotionEvent ev) {
                    Rect dialogBounds = new Rect();
                    getWindow().getDecorView().getHitRect(dialogBounds);
                
                    if (!dialogBounds.contains((int) ev.getX(), (int) ev.getY())) {
                        // Tapped outside so we finish the activity
                        this.finish();
                    }
                    return super.dispatchTouchEvent(ev);
                }
                

                這篇關于點擊 Android 對話框外部以將其關閉?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                How can I detect integer overflow on 32 bits int?(如何檢測 32 位 int 上的整數溢出?)
                Local variables before return statements, does it matter?(return 語句之前的局部變量,這有關系嗎?)
                How to convert Integer to int?(如何將整數轉換為整數?)
                How do I create an int array with randomly shuffled numbers in a given range(如何在給定范圍內創建一個隨機打亂數字的 int 數組)
                Inconsistent behavior on java#39;s ==(java的行為不一致==)
                Why is Java able to store 0xff000000 as an int?(為什么 Java 能夠將 0xff000000 存儲為 int?)

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

                        <bdo id='8xDmF'></bdo><ul id='8xDmF'></ul>

                          <tbody id='8xDmF'></tbody>

                          <small id='8xDmF'></small><noframes id='8xDmF'>

                        • <tfoot id='8xDmF'></tfoot>
                          主站蜘蛛池模板: 国产日韩欧美一区二区在线播放 | av大全在线观看 | 请别相信他免费喜剧电影在线观看 | 日韩成人影院 | 国产农村妇女精品一区 | 国产日本精品视频 | 国产福利视频导航 | 国产精品国产三级国产aⅴ无密码 | 亚洲欧美第一视频 | 久久久人 | 日韩视频a | 五月综合激情网 | 欧美在线综合 | 中文字幕一区二区三区乱码图片 | 亚洲欧洲视频 | 欧美日韩亚洲一区二区 | 国产欧美一区二区三区日本久久久 | 91日b| 成人做爰69片免费观看 | 国产精品欧美日韩 | 人碰人操| 久久中文视频 | 久久久国产精品一区 | 精品国产乱码久久久久久丨区2区 | 日日夜夜天天 | 国产精品美女久久久久久不卡 | 国产成人精品高清久久 | 在线观看亚洲专区 | 天堂亚洲| 成在线人视频免费视频 | 青青久久av北条麻妃海外网 | 日韩一区二区视频 | 1000部精品久久久久久久久 | 国产欧美日韩二区 | 国产一区二区三区在线视频 | 日韩一区二区三区精品 | 亚洲国产成人av好男人在线观看 | 亚洲第一黄色网 | 国产精品日韩在线观看一区二区 | 操久久| 亚洲顶级毛片 |