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

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

<legend id='8812D'><style id='8812D'><dir id='8812D'><q id='8812D'></q></dir></style></legend>
    <bdo id='8812D'></bdo><ul id='8812D'></ul>

      <small id='8812D'></small><noframes id='8812D'>

      1. 在 Android 上,如何檢測顯示系統(tǒng)對話框(電源選項

        On Android, how to detect a system dialog is displayed (power options, recent apps, low battery...)?(在 Android 上,如何檢測顯示系統(tǒng)對話框(電源選項、最近的應用程序、低電量...)?) - IT屋-程序員軟件開發(fā)技術

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

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

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

                  <tfoot id='vBNqm'></tfoot>

                • 本文介紹了在 Android 上,如何檢測顯示系統(tǒng)對話框(電源選項、最近的應用程序、低電量...)?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想捕捉任何導致我的活動顯示甚至部分隱藏的東西,例如電源選項、最近的應用程序托盤、低電量通知等...我很難檢測到這些系統(tǒng)事件.

                  I'd like to catch anything that causes the display of my Activity to get even partially hidden, e.g. power options, recent apps tray, low battery notification, etc... and I'm having a hard time to detect these system events.

                  我很確定當此類事件發(fā)生時會調(diào)用 onPause(),但它似乎是錯誤的......還是我?

                  I was pretty sure onPause() would be called when such events happen, but it seems to be wrong... or is it me?

                  還有其他想法嗎?...我最好不要單獨掛鉤每個系統(tǒng)廣播操作,因為我希望盡可能通用(并對隱藏我的 Activity 的任何事情做出反應).

                  Any other idea?... I'd preferably not hook on each system broadcast action individually, since I'd like to be as generic as possible (and react to ANYTHING that hides my Activity).

                  推薦答案

                  在開發(fā)一個 kiosk 風格的應用程序時,我知道一些 Dialogs 會出現(xiàn)在前臺并且可以被檢測到

                  On working on a kiosk style app I know that some Dialogs come to the foreground and can be detected by

                      ActivityManager activityManager = (ActivityManager)getBaseContext()
                         .getSystemService(Activity.ACTIVITY_SERVICE);
                      String className = activityManager.getRunningTasks(1).get(0).topActivity.getClassName();
                  

                  一個例子是藍牙綁定對話框,它將 com.android.settings 帶到前臺.

                  An example for that is the bluetooth-binding dialog that brings the com.android.settings to the foreground.

                  一個反例是沒有出現(xiàn)在前臺的電源按鈕對話框(關閉、重啟等).

                  A counter-example is the power-button dialog (Turn off, Reboot etc) that does not come to the foreground.

                  請注意,您可以使用此廣播關閉系統(tǒng)對話框(甚至是電源按鈕對話框):

                  Note that you can close system dialogs (even the power-button dialog) with this broadcast:

                      Intent closeDialog = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
                          sendBroadcast(closeDialog);
                  

                  但在大多數(shù)(所有較新的?)設備上,此廣播甚至會關閉軟件鍵盤,因此不建議運行頻繁發(fā)送它的服務,因為用戶將無法在文本字段中輸入任何內(nèi)容.

                  But on most (all newer?) devices this Broadcast will even close the software keyboard, so it is not advisable to have a service running that frequently sends it as the user will then be unable to enter anything into a text field.

                  請注意,此類行為肯定會使您的應用程序成為惡意軟件,使其無法在 google play 上發(fā)布.

                  Note that such behaviour will definetly gratify your app a status as beeing malware, keeping it from beeing published on google play.

                  這篇關于在 Android 上,如何檢測顯示系統(tǒng)對話框(電源選項、最近的應用程序、低電量...)?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(liá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)絡提供商)
                  Get current location during app launch(在應用啟動期間獲取當前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)

                    <legend id='12i70'><style id='12i70'><dir id='12i70'><q id='12i70'></q></dir></style></legend>

                    <small id='12i70'></small><noframes id='12i70'>

                        <bdo id='12i70'></bdo><ul id='12i70'></ul>
                          <tbody id='12i70'></tbody>
                        • <i id='12i70'><tr id='12i70'><dt id='12i70'><q id='12i70'><span id='12i70'><b id='12i70'><form id='12i70'><ins id='12i70'></ins><ul id='12i70'></ul><sub id='12i70'></sub></form><legend id='12i70'></legend><bdo id='12i70'><pre id='12i70'><center id='12i70'></center></pre></bdo></b><th id='12i70'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='12i70'><tfoot id='12i70'></tfoot><dl id='12i70'><fieldset id='12i70'></fieldset></dl></div>
                          • <tfoot id='12i70'></tfoot>
                            主站蜘蛛池模板: 国产免费拔擦拔擦8x高清 | 国产自产21区 | 久热精品在线观看视频 | 中文字幕一区二区三区日韩精品 | 日日摸夜夜添夜夜添特色大片 | 国产精品视频yy9299一区 | 伊人网站视频 | 日韩欧美在线观看 | 免费一级毛片 | 爱操影视 | 一区在线观看 | 91亚洲精品国偷拍自产在线观看 | chengrenzaixian| 在线一区视频 | 亚洲精品久久久久中文字幕欢迎你 | 一区二区三区不卡视频 | 日本三级日产三级国产三级 | 欧美区日韩区 | 91麻豆精品国产91久久久更新资源速度超快 | 91精品国产色综合久久不卡98 | 成人在线一区二区三区 | 欧美久久不卡 | 亚洲网站在线观看 | 亚洲精品中文字幕在线 | 国产黄色在线观看 | 日本天堂视频在线观看 | 日韩一区二区三区在线 | h视频在线看| 成人在线不卡 | 亚洲xxxxx | 亚洲日本视频 | 国产一区影院 | 欧美性一区二区三区 | 亚洲精品国产区 | av永久| 欧美日韩1区 | 国产韩国精品一区二区三区 | 国产一区二区在线观看视频 | 国产在线一区二区三区 | 夜夜爽99久久国产综合精品女不卡 | 国产精品久久久久久中文字 |