<legend id='xqvOR'><style id='xqvOR'><dir id='xqvOR'><q id='xqvOR'></q></dir></style></legend>

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

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

        • <bdo id='xqvOR'></bdo><ul id='xqvOR'></ul>
      2. 如何检测屏幕旋转?

        时间:2023-05-19

        <legend id='iWgLz'><style id='iWgLz'><dir id='iWgLz'><q id='iWgLz'></q></dir></style></legend>

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

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

                  <tfoot id='iWgLz'></tfoot>
                2. 本文介绍了如何检测屏幕旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  是否可以检测屏幕旋转?我的意思是 - 仅轮换,这与活动初始化与另一个活动有明显区别?

                  is it possible to detect screen rotation? I mean - rotation only, which is clearly distinguishable from activity initialization from another activity?

                  onXxx 方法似乎对此没有用,我尝试从 starting Intent 添加/删除 flag (删除似乎没有反映,在旋转标志在那里),并尝试为清单中的活动添加 android:configChanges="orientation" ,但是 onConfigurationChanged 方法似乎每秒钟旋转一次...有线.

                  The onXxx methods seem not to be useful for this, I have tried adding/removing a flag from the starting Intent (the removing seems not to be reflected, on rotate the flag is there), and have tried adding android:configChanges="orientation" for the activity in the manifest, however the onConfigurationChanged method seems to be called every second rotation... wired.

                  我想我遗漏了一些东西......但在其他相关线程中没有找到明确的解决方案.

                  I guess I am missing something... but haven't found clear solution in the other related threads.

                  有什么想法吗?

                  推荐答案

                  清单:

                  <activity android:name=".MyActivity" android:configChanges="screenSize|orientation|screenLayout|navigation"/>
                  

                  活动:

                  @Override
                  public void onConfigurationChanged(Configuration newConfig)
                  {
                      Log.d("tag", "config changed");
                      super.onConfigurationChanged(newConfig);
                  
                      int orientation = newConfig.orientation;
                      if (orientation == Configuration.ORIENTATION_PORTRAIT)
                          Log.d("tag", "Portrait");
                      else if (orientation == Configuration.ORIENTATION_LANDSCAPE)
                          Log.d("tag", "Landscape");
                      else
                          Log.w("tag", "other: " + orientation);
                  
                      ....
                  }
                  

                  也试试这个链接

                  如何检测屏幕旋转

                  这篇关于如何检测屏幕旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何通过手指触摸自动围绕中心点旋转图像 下一篇:IOS 6屏幕旋转不使用情节提要

                  相关文章

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

                3. <tfoot id='m3oIu'></tfoot>

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

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