模拟器的内置应用程序无法检测方向变化
我认为这是一个简单的问题,但我在任何地方都找不到答案!
在我的模拟器(Windows 7 上的 SDK 9)上,许多内置应用程序无法正确响应方向更改。它们包括:浏览器(!)、闹钟、计算器、Api 演示。它们可以正确地更改为横向模式,但当模拟器转回纵向时,它们仍保持横向模式。不过,其他一些内置应用程序也很好,它们是主屏幕、启动器和电话拨号器。
我尝试了以下操作来查看发生了什么:
@Override
public void onCreate(Bundle savedInstanceState) {
....
boolean bLandscape = getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE;
....
}
我看到的是:当模拟器切换到风景模式时,它返回了正确的结果。但是当模拟器返回时,它仍然显示处于横向模式!
只有我吗?有人对此有任何见解吗?谢谢你,一如既往!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是模拟器的一个已知错误。这不会在真实设备上发生,并且与这些应用程序的编码方式无关。
错误记录位于此处,
有关详细信息,请参阅此处
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