I know there are two ways to set an Activity
's orientation to landscape, either programmatically
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
or in the Manifest:
android:orientation="landscape"
Currently, I use the first one in a superclass, because I have many (child) activities that I all want to be always in landscape. However, this make
onCreate
being called twice, which leads to other issues. When using the Manifest-route, I have to apply it to all activities separately, which will undoubtedly lead to one being missed out in the future (not to mention all the code copying).
Is there a way to apply android:orientation="landscape"
to all activities in my app?