klanm
klanm

Reputation: 3278

configChanges="orientation" doesn't trigger on Galaxy Nexus

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?

Upvotes: 5

Views: 4081

Answers (4)

tim
tim

Reputation: 628

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

Upvotes: 0

user1190887
user1190887

Reputation: 111

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

Upvotes: 0

Aswin Kumar
Aswin Kumar

Reputation: 5278

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.

Upvotes: 0

StenaviN
StenaviN

Reputation: 3697

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

Upvotes: 6

Related Questions