处理显示旋转的Android [英] Handling display rotation in Android
问题描述
我是新的Android系统。在我的应用程序的开发,我要处理的显示器(屏)旋转。是否有任何监听器来处理这个事件?或者是有什么替代的方式来处理这种情况?
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().
更多细节在这里:处理运行时更改
这篇关于处理显示旋转的Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!