开发者

Emulator's built-in application can't detect orientation change

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 开发者_如何学JAVAfine, 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!


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜