处理显示旋转的Andr​​oid [英] Handling display rotation in Android

查看:83
本文介绍了处理显示旋转的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新的Andr​​oid系统。在我的应用程序的开发,我要处理的显示器(屏)旋转。是否有任何监听器来处理这个事件?或者是有什么替代的方式来处理这种情况?

I am new the Android. In my application development, I want to handle the display (screen) rotation. Is there any listener is available to handle this event? Or is there any alternate way to handle this situation?

感谢和放大器;问候,

巴拉

推荐答案

比方说,你要处理的方向改变自己,用 configChanges =定向在您的活动在manifest.xml

Let's say you want to handle the orientation change yourself, use configChanges="orientation" in your activity in the manifest.xml

<activity android:name=".MyActivity"
          android:configChanges="orientation"
          android:label="@string/app_name">

现在,当这些配置之一变,MyActivity不重新启动。相反,活动收到呼叫 onConfigurationChanged()。

Now when one of these configurations change, MyActivity is not restarted. Instead, the Activity receives a call to onConfigurationChanged().

更多细节在这里:处理运行时更改

这篇关于处理显示旋转的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆