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

    <legend id='8EYBO'><style id='8EYBO'><dir id='8EYBO'><q id='8EYBO'></q></dir></style></legend>
  1. <small id='8EYBO'></small><noframes id='8EYBO'>

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

      Android:旋轉更改后對話框等恢復

      Android: Dialog etc restore after rotation changed(Android:旋轉更改后對話框等恢復)

        <tbody id='6ILol'></tbody>

        <legend id='6ILol'><style id='6ILol'><dir id='6ILol'><q id='6ILol'></q></dir></style></legend>

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

              <small id='6ILol'></small><noframes id='6ILol'>

            • <tfoot id='6ILol'></tfoot>
                <bdo id='6ILol'></bdo><ul id='6ILol'></ul>
              • 本文介紹了Android:旋轉更改后對話框等恢復的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                旋轉屏幕后如何恢復對話框等?例如,彈出一個 alertDialog 告訴用戶一些信息.然后用戶將屏幕旋轉到另一個方向.如何恢復alertDialog?任何人都可以指導我這樣做嗎?謝謝!

                How to restore the dialog etc after rotating the screen? For example, pop up an alertDialog to tell user some information. then the user rotate the screen to another orientation. How to restore the alertDialog? Can any one guide me to do it? Thanks!

                稍后添加:

                我查看了android源代碼并找到了這些東西:

                I looked into the android source code and find these things:

                對話框存儲在mManagedDialogs中,相關信息為:

                Dialogs are stored in mManagedDialogs, and the related information is:

                mManagedDialogs = new SparseArray<ManagedDialog>();
                

                onSaveInstanceState相關:

                final void performSaveInstanceState(Bundle outState) {
                    onSaveInstanceState(outState);
                    saveManagedDialogs(outState);
                }
                

                saveManagedDialogs中,與mManagedDialogs有關.

                onRestoreInstanceState相關:

                final void performRestoreInstanceState(Bundle savedInstanceState) {
                    onRestoreInstanceState(savedInstanceState);
                    restoreManagedDialogs(savedInstanceState);
                }
                

                restoreManagedDialogs中,與mManagedDialogs有關.

                如您所見,對于高級功能,您必須自己完成保存和恢復工作.當您擁有大量自定義對話框時,這可能是一場噩夢.我沒有嘗試過復雜的對話框(例如輸入了 EdiText、listView).通過這種方式,我想警告用戶:在對話框中輸入信息時切勿旋轉屏幕......或者,在顯示對話框時動態鎖定旋轉.

                As you can see, for advanced feature, you must do the saving and restoring job by yourself. It may be a night mare when you have tons customized dialogs. I have not tried the complex dialog (has input EdiText, listView, say). In this way, I'd like to warn users: Never rotate the screen when inputing your info in the dialog... OR, lock the rotation dynamically when showing the dialog.

                感謝所有回答我的人.希望我的信息也能幫到你.

                Thanks for all the people who answered me. Hope my information help you too.

                推薦答案

                我采取的方法是不允許操作系統在布局配置更改后重新啟動您的活動.為此,請在清單文件中要阻止重新啟動的活動中添加此行:

                The approach I took was to not allow the OS to restart your activity after the layout configuration change. To accomplish this, add this line within activities that you want to prevent from restarting in your manifest file:

                 <activity
                 android:configChanges="orientation|keyboard"
                 ...
                 >
                

                您可以選擇在代碼中處理配置更改,以防您想要手動進行一些布局更改,例如從 XML 重新加載新視圖.這是通過覆蓋 Activity 類中的 onConfigurationChanged() 方法來完成的:

                Optionally, you can handle the configuration change in code in case there are some layout changes you want to make manually, such as reloading a new view from XML. This is done by overwriting the onConfigurationChanged() method in your Activity class:

                @Override
                public void onConfigurationChanged(Configuration newConfig)
                {
                    //Handle config changes here, paying attention to
                    //the newConfig.orientation value
                    super.onConfigurationChanged(newConfig);
                }
                

                在配置更改列表中添加了|keyboard"

                Added "|keyboard" to the list of config changes

                這篇關于Android:旋轉更改后對話框等恢復的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)

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

                        <tbody id='RqQDy'></tbody>

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

                          主站蜘蛛池模板: 亚洲高清一区二区三区 | 成人av片在线观看 | 国产成人精品一区二区三区网站观看 | 亚洲伊人久久综合 | 国产精品入口久久 | 黄色网址在线免费观看 | 中文字幕在线观 | 精国产品一区二区三区四季综 | 亚洲人成人一区二区在线观看 | 97在线播放 | 欧美精品欧美精品系列 | 亚洲精品黄色 | 精国产品一区二区三区 | 男人天堂网址 | 欧美激情在线一区二区三区 | 欧美日一区 | 一级做a爰片性色毛片 | 在线观看成人小视频 | 欧美中文字幕 | 欧美亚洲高清 | 日本在线免费看最新的电影 | 黄色片免费| 在线一区视频 | 精品视频在线免费观看 | 国产一卡二卡三卡 | 欧美三级网站 | 亚洲精品一区二区三区在线 | 中文字幕在线一区二区三区 | 日韩欧美视频 | 色资源在线 | 九一视频在线观看 | 欧美xxxx网站 | 久久久久亚洲精品 | h片在线看| 狠狠操婷婷 | 成人精品国产一区二区4080 | 国产99久久久久 | 成人午夜免费视频 | 中文字幕精品一区二区三区精品 | 免费黄色日本 | 在线永久看片免费的视频 |