2

I thought this is an easy problem, but I just can't find an answer anywhere!

On my Emulator (SDK 9 on Windows 7), many built-in applications can't respond correctly to orientation change. They include: browser(!), alarm clock, calculator, Api Demos. They can correctly change to landscape mode, but when the emulator is turned back to portrait, they stay in landscape mode. However, a few other built-in applications are fine, they are Home screen, launcher, and phone dialer.

I tried the following to see what's going on:

@Override
public void onCreate(Bundle savedInstanceState) {
    ....
    boolean bLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
    ....
}

What I saw was: When the emulator is turned to landsacpe mode, it returned the correct result. But when the emulator turns back, it still says it's in landscape mode!

Is it just me? Does anybody have any insight on this? Thank you, as always!

wwyt
  • 2,701
  • 4
  • 32
  • 42
  • A stupid question, but how long did you wait after switching the orientation back? Sometimes the emulator takes quite some time before rendering the layout in new orientation. At least that has happened to me. – Timo Mar 11 '11 at 21:45
  • @Timo Well, I wouldn't call you stupid back, that simply made me ... But two things to answer: If I got to see them turn to landscape, wouldn't I have waited long enough for them to turn back? Besides, I said I have checked programmatically, if onCreate() got called, one could easily infer that the wait is long enough. – wwyt Mar 11 '11 at 22:50

1 Answers1

2

This is a known bug with the emulator. This will not happen on a real device and has nothing to do with the way any of these apps were coded.

The bug writeup is here

for some more info see here

Community
  • 1
  • 1
providence
  • 29,135
  • 13
  • 46
  • 62