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

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

      • <bdo id='YLjaX'></bdo><ul id='YLjaX'></ul>
      <legend id='YLjaX'><style id='YLjaX'><dir id='YLjaX'><q id='YLjaX'></q></dir></style></legend>

      如何在 Android 上的方向更改时避免重新启动活动

      How to avoid restarting activity when orientation changes on Android(如何在 Android 上的方向更改时避免重新启动活动)
      <legend id='G2rvD'><style id='G2rvD'><dir id='G2rvD'><q id='G2rvD'></q></dir></style></legend>
        <bdo id='G2rvD'></bdo><ul id='G2rvD'></ul>
        • <tfoot id='G2rvD'></tfoot>
                <tbody id='G2rvD'></tbody>

            1. <small id='G2rvD'></small><noframes id='G2rvD'>

            2. <i id='G2rvD'><tr id='G2rvD'><dt id='G2rvD'><q id='G2rvD'><span id='G2rvD'><b id='G2rvD'><form id='G2rvD'><ins id='G2rvD'></ins><ul id='G2rvD'></ul><sub id='G2rvD'></sub></form><legend id='G2rvD'></legend><bdo id='G2rvD'><pre id='G2rvD'><center id='G2rvD'></center></pre></bdo></b><th id='G2rvD'></th></span></q></dt></tr></i><div id='G2rvD'><tfoot id='G2rvD'></tfoot><dl id='G2rvD'><fieldset id='G2rvD'></fieldset></dl></div>

                本文介绍了如何在 Android 上的方向更改时避免重新启动活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我正在创建一个在画布上绘制视图的 Android 应用.当设备的方向改变时,活动重新启动.我不想这样.

                I am creating an Android app in which I'm drawing a view on a canvas. When the device's orientation changes, the activity restarts. I don't want it to.

                如何避免在方向改变时重新启动活动?

                How can I avoid restarting the activity when the orientation changes?

                推荐答案

                有多种方法可以做到,但是给定 这里,使用

                There are various ways to do it, but as given here, using

                android:configChanges="keyboardHidden|orientation|screenSize"
                

                允许您监听配置更改.然后,您通过覆盖 onConfigurationChanged 并调用 setContentView 来响应这些更改.

                allows you to listen for the config changes. You then respond to these changes by overriding onConfigurationChanged and calling setContentView.

                这就是我一直这样做的方式,但我很想知道其他人的想法.

                This is the way I've been doing it, but I'd be interested to know other people's thoughts.

                这篇关于如何在 Android 上的方向更改时避免重新启动活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                How can I use CClistview in COCOS2d Android?(如何在 COCOS2d Android 中使用 CClistview?)
                cocos2d-android: how to display score(cocos2d-android:如何显示分数)
                Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
                SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
                Android file copy(安卓文件拷贝)
                Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)
                <i id='JCaxp'><tr id='JCaxp'><dt id='JCaxp'><q id='JCaxp'><span id='JCaxp'><b id='JCaxp'><form id='JCaxp'><ins id='JCaxp'></ins><ul id='JCaxp'></ul><sub id='JCaxp'></sub></form><legend id='JCaxp'></legend><bdo id='JCaxp'><pre id='JCaxp'><center id='JCaxp'></center></pre></bdo></b><th id='JCaxp'></th></span></q></dt></tr></i><div id='JCaxp'><tfoot id='JCaxp'></tfoot><dl id='JCaxp'><fieldset id='JCaxp'></fieldset></dl></div>
                1. <legend id='JCaxp'><style id='JCaxp'><dir id='JCaxp'><q id='JCaxp'></q></dir></style></legend>
                  • <small id='JCaxp'></small><noframes id='JCaxp'>

                      <tfoot id='JCaxp'></tfoot>

                        • <bdo id='JCaxp'></bdo><ul id='JCaxp'></ul>
                            <tbody id='JCaxp'></tbody>