Impossible to rotate the emulator with android 4.4 [duplicate]

此生再无相见时 提交于 2019-11-27 06:52:13

These appear to be bugs in the Android 4.4 emulator. You may wish to track the issues that I filed regarding the orientation change bug and the overflow affordance bug.

Thanks for pointing these out!

There appears to be a bug in the emulator as described by CommonsWare, however, if you desperately need to debug an app in landscape mode on the 4.4 emulator you can:

  1. Start the Camera app on the emulator which will rotate the screen.
  2. Now exit the app, the home screen should now be sideways.
  3. Pressing Ctrl + F11 will do the trick. (Ctrl + fn + F11 on mac).

Until it is fixed I use this free application "Set Orientation". Install the apk into emulator using adb install.

I have found that this bug depends on which device type I select for the virtual-machine. If I set the device type as a "Nexus 7", it won't allow rotations. But if I set the device type as a generic 7" tablet, with all of the same options, rotations will work fine.

In manifestfile.xml can put android:screenOrientation="landscape". When it has been Loaded you will see every app in landscape mode

There is a work around for this. It seems the settings from the GUI isn't saved to the ini files. I had to manually edit fields "hw.keyboard=no" in both config.ini & hardware-qemu.ini within your avd directory.

As a workaround, I cloned the device, swapped the width/height in the clone and unchecked portrait. Then launched my avd based on the cloned landscape version. Maybe that could work for you?

I ran into the same issue when using the emulator running Android 5.0.1. However, I was able to resolve by using the emulator with Intel x86 Atom system image instead of the Intel x86 Atom_64 system image.

I have found a solution to this problem -

  • Create emulator with whatever setting you want but set the Target to be less then Android 4.4.

For example -

I set it to the following -->

NOTE:

Because I want to use Android 4.4 with Google Maps API so I used Android 4.2.2 with Google Maps API here.

  • After creating the AVD, start it and lets get it started completely.

  • Now come back to this AVD and edit it. Here you set the Target to Android 4.4 with Google Maps API.

For example -

I set it to the following -->

  • Now start the application and rotate any way you want. It worked great!
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!