【发布时间】:2011-02-25 20:39:29
【问题描述】:
可能重复:
Don’t want activity to be destroyed/created when phone is rotated
我正在尝试编写一个程序,该程序在手机四处旋转时需要平滑的方向传感器样本。每次更改手机的方向时,它都会在布局更改时中断数据并冻结程序。如何将其锁定在一个方向(横向或纵向,没关系)?
我认为它与xml文件中的android:layout有关,但我在网上找不到任何东西。
【问题讨论】:
标签: java android orientation sensors screen-orientation