Android 2.3 emulator orientation changes
Asked Answered
R

4

7

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?

Redemptioner answered 3/1, 2011 at 12:23 Comment(1)
I'm having the same problem, but suspected my own code to be responsible for that.Kerby
R
0

It seems to be a problem with the emulator, since the Settings app (for example) does the same thing (although the Launcher doesn't, which leads me to believe the Launcher app uses some other mechanism to detect orientation changes).

I'll mark this answer as accepted in a couple days, until then please feel free to shed some light if you have it.

Redemptioner answered 3/1, 2011 at 14:34 Comment(0)
B
10

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).

Beera answered 26/1, 2011 at 8:52 Comment(0)
R
0

It seems to be a problem with the emulator, since the Settings app (for example) does the same thing (although the Launcher doesn't, which leads me to believe the Launcher app uses some other mechanism to detect orientation changes).

I'll mark this answer as accepted in a couple days, until then please feel free to shed some light if you have it.

Redemptioner answered 3/1, 2011 at 14:34 Comment(0)
G
0

Seems to be a problem with the emulator indeed.

Grandfatherly answered 8/1, 2011 at 0:2 Comment(0)
R
0

While testing on the 2.3.3 emulator, I am setting android:screenOrientation="behind" for each activity.

Reliquary answered 4/3, 2012 at 12:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.