Question

Hello I have a strange bug, when I want to trigger the orientation change on the Galaxy Nexus(4.0.4), it simply doesn't jump into the onConfigurationChanged(Configuration) function. On the HTC Desire(4.0.4) it works without any issues with the same code. And even on an emulator with 720p it works. I tried to update to Android 4.1, but I still have the same problem.

Does anyone have the same problems or any solutions?

Était-ce utile?

La solution

I see both devices running Android 4.x, but try adding screenSize value as described in my earlier answer here.

Autres conseils

In the manifest, int the <activity> tag, add android:configChanges="orientation". This tells the system that your activity will handle orientation changes by itself, hence the onConfigurationChanged() will be triggered.

screenSize flag on Android 4.X needed. Try another android compiler builder.

If you have called setRequestedOrientation(..) in the activity before, the onConfigurationChanged(Configuration) will not be triggered by the system auto-detect of rotation.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top