In the manifest, set this for all your activities:
<activity android:name=".YourActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
Let me explain:
- With
android:configChanges="orientation"
you tell Android that you will be responsible of the changes of orientation.
android:screenOrientation="portrait"
you set the default orientation mode.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…