在整个应用程序的Android编程方式禁用方向
Programatically disabling orientation in entire application Android
作为保持它在纵向或横向无论哪种方式的设备倾斜? 您需要将它添加到你的清单,你要限制活动里面
As in keep it in portrait or Landscape no matter which way device is tilted? You need to add this to your manifest inside the activity that you want to limit
android:screenOrientation="portrait" //Or landscape for horizontal.
如果你想要不同的活动只是让你的清单看起来是这样的。
If you want it different between activities just make your manifest look like this.
<activity android:name=".Activity1"
android:screenOrientation="landscape">
</activity>
<activity android:name=".Activity2"
android:screenOrientation="portrait">
</activity>
<activity android:name=".Activity3"
android:screenOrientation="landscape">
</activity>