I want my android application to be only run in portrait mode? How can I do that?
On the main screen of Rotation Manager, select an orientation by tapping on either the vertical or horizontal icons next to a specific app to lock it into either landscape or portrait mode. Highlighting both icons will allow that particular app to auto-rotate.
In the manifest, set this for all your activities:
<activity android:name=".YourActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
Let me explain:
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.In Android Manifest File, put attribute for your <activity>
that android:screenOrientation="portrait"
There are two ways,
android:screenOrientation="portrait"
for each Activity in Manifest Filethis.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
in each java file.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With