android - Make screenOrientation configurable? -


my activity forces portrait mode using android:screenorientation="portrait" in manifest. however, of users (on tablets default in landscape mode) have asked me make configurable option. possible set orientation in code (without triggering orientation-change animation, before activity displayed)?

yes, call:

 activity.setrequestedorientation (int requestedorientation) 

taken from

http://developer.android.com/reference/android/app/activity.html#setrequestedorientation%28int%29

if want lock screen orientation after setting it, take @ post:

screen orientation lock


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -