5

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?

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
klanm
  • 3,168
  • 3
  • 19
  • 22

4 Answers4

6

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

Community
  • 1
  • 1
StenaviN
  • 3,687
  • 24
  • 34
0

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.

Aswin Kumar
  • 5,158
  • 5
  • 34
  • 39
0

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

Chintan Khetiya
  • 15,962
  • 9
  • 47
  • 85
user1190887
  • 111
  • 1
  • 7
0

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

tim
  • 627
  • 2
  • 7
  • 15