Is the there a way to set a landscape mode to the whole application, not by adding android:screenOrientation="portrait"
to every activity in AndroidManifest?
Here's the only thing I can think of. Write a class that extends Activity and put the following in that class:
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Then, instead of extending Activity in your other classes, extend the new class.
One programmatic way of doing this, that I can think of, is to create a super class that extends activity and extend all your classes from there.
Have the below setting in the super class in a protected method and call super.xxx() to initiate this:
setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
In case you what a specific activity in a different way you can simply override this.
[I have not tried this yet, but by the knowledge of OOP this works]
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