Change Orientation At Runtime
I'm new to android my question is, Is it possible to change orientation programmatically? If yes, how can we do that?
Solution 1:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
Also add this in your manifest file (under activity):
android:configChanges = "orientation"
Solution 2:
Yes, use setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); to force orientation
Post a Comment for "Change Orientation At Runtime"