I know that you can set the screen orientation in AndroidManifest.xml file, either to a specific orientation or to follow accelerometer. But this has to be done before compiling the app.
I was wondering if this is possible on run time via code. My app provides an option to compare 2 tables side by side. Since landscape orientation provides more width than portrait, I have set in the XML file to make this activity work only in landscape mode. Today I tested the app on a tablet and realised these high resolution screens can accommodate 2 tables side by side in portrait mode itself.
So here is what I want to do:
If 100%x <= 480dip Then orientation = landscape only Else orientation = both
Is this possible?
I was wondering if this is possible on run time via code. My app provides an option to compare 2 tables side by side. Since landscape orientation provides more width than portrait, I have set in the XML file to make this activity work only in landscape mode. Today I tested the app on a tablet and realised these high resolution screens can accommodate 2 tables side by side in portrait mode itself.
So here is what I want to do:
If 100%x <= 480dip Then orientation = landscape only Else orientation = both
Is this possible?