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?

有帮助吗?

解决方案

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

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top