I want to programmatically change the orientation when working with an Android application with these lines of code:
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
They still work, but the main problem is that all the activity restarts when the screen orientation changes, and I do not want this. Is it possible? Thank.
EDIT: Well, after I found out what I was missing. I had to include also "screenSize" in the configChanges property, so
android:configChanges="orientation|screenSize"
decided all this.
android screen-orientation
luisfer Feb 14 '13 at 11:26 2013-02-14 11:26
source share