Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android 2.3 emulator orientation changes

I ran into a bit of a problem, which I think is related to the emulator itself. I have put this code right at the top of my onCreate method in one of my activities:

Log.d(Const.TAG, "onCreate orientation: " + getRequestedOrientation());

Everytime I switch orientation in the emulator (via Ctrl+F11 and/or Num 7), it prints -1 (which corresponds to SCREEN_ORIENTATION_UNSPECIFIED), and it gets stuck in landscape (doesn't switch back to portrait unless I relaunch the app).

Am I doing something wrong? Is anyone else having this problem? Is it a problem related strictly to the 2.3 emulator or does it appear on devices (Nexus S currently) as well?

like image 645
Felix Avatar asked Jan 03 '11 12:01

Felix


1 Answers

This is a problem with the emulator. See: http://code.google.com/p/android/issues/detail?id=13189

and on stackoverflow: why does the gingerbread emulator orientation get stuck in apps?

Unfortunately, this problem isn't addressed with the 10.0 Android SDK (released 2/2011).

like image 200
ThomasW Avatar answered Nov 07 '22 05:11

ThomasW