In my application If i want to restrict an activity to work in portrait mode only then i have to write android:screenOrientation="portrait"
in the manifest file against activity tag. If I want to force all activity to work in portrait mode then I have to write the same in all activity. Is there any application-wise setting so that I need not have to write this in all activities. How to make an application to run in portrait mode only
<activity
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation"
android:name=".MyActivity"></activity>
Android Settings Start by going to Settings => Display and locate the “Device rotation” setting. On my personal cell phone, tapping this will reveal two options: “Rotate the contents of the screen,” and “Stay in portrait view.”
If you want to develop an application in portrait mode, add screenOrientation inside application tag. In the above result it is showing only portrait mode. now turn your device it not going to change the view according to orientation.
In onCreate() of your Application class, include the following code. Show activity on this post. use these line inside your application tag. it may help you or use this line android:screenOrientation="portrait" with each activity.
Only way is to add android:screenOrientation="portrait"
for each activity.
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