久久久久久久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'>

                          主站蜘蛛池模板: 欧日韩在线观看 | www.亚洲精品 | 欧美毛片免费观看 | 欧美一区二区在线看 | 免费成人高清在线视频 | 免费在线观看黄视频 | 亚洲欧美中文日韩在线v日本 | 成人精品一区二区三区中文字幕 | 亚洲精品视频在线 | 性做久久久久久免费观看欧美 | 天堂资源 | 日本成人一区二区 | 成人免费一区二区三区牛牛 | 成人精品一区二区三区中文字幕 | www国产成人 | 一本一道久久a久久精品综合 | 久久久999免费视频 999久久久久久久久6666 | 在线观看成年人视频 | 久久亚洲国产精品日日av夜夜 | 亚洲自拍一区在线观看 | 免费成人在线网 | 亚洲福利在线视频 | 365夜爽爽欧美性午夜免费视频 | 黄色在线免费观看 | 国产精品久久久久久久久久不蜜臀 | 日韩高清一区二区 | 蜜臀网 | 日韩欧美高清dvd碟片 | 国产视频福利在线观看 | 成人性视频免费网站 | 精品欧美 | 亚洲精品1区 | 黄色毛片在线观看 | 日韩精品在线免费观看 | 天天爱综合| 精品成人| 国产精品自拍视频网站 | 一区二区高清在线观看 | 中文字幕一区在线观看视频 | 伊人一二三| 精品国产欧美一区二区三区不卡 |