App works fine in android 3.2 but not in android 3.1
My application is in landscape mode and I have manifest saying
<activity
android:name=".GameActivity"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden"
>
and have override the onConfigchanges where i setting it in Landscape Mode.
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
}
Now the issue is When i run my application in 3.1 there is some wierd problem happening.
When I press home screen ..make it in potrait mode and again come back my app starts activity but shows half screen of my current activity and other activity which isingleTop.
Half screen of my current activity and on top of that old activity
It is weird I do not know why this is happening
See, documentation about android:configChanges about value
screenSize.So on android 3.2 setting:
android:configChanges="orientation"is effectively ignored since screenSize is leading to recreation of activity. On android 3.1 you prevent recreation of Activity when orientation changes.So remove
orientationvalue and it should be Ok, apparently automatic recreation of activity is good for you. Or addscreenSizevalue and be happy that same bug is present in both versions.This is kind of funny bug of android that switching between activities with different orientation leads to configuration change of activity which has fixed orientation.