Android - Emulator in landscape mode, screen does not rotate

AndroidAndroid EmulatorAvd

Android Problem Overview


When I switch to landscape mode (NUMPAD 7 or CTRL+F11) the emulator rotates the screen to landscape orientation but the Android OS and none of the apps rotate. So everything is sitting sideways. Is there something in the AVD configuration that needs to be set in order for the device to rotate properly?

enter image description here

Android Solutions


Solution 1 - Android

Another answer here:

in my case the problem was simply that the auto-rotate setting in the android emulator settings (accessible pulling down the notification bar) was disabled, my bad.

Solution 2 - Android

I spent more time then I'd like to admit scratching my head why my app was rotating fine on my device but not in the emulator... in the emulator pull the drop-down OS menu and make sure "auto-rotate" is enabled. emulator screenshot

Solution 3 - Android

In my case it was solved by disabling the "Hardware keyboard present" checkbox in the "Edit Android Virtual Device (AVD)" window.

Solution 4 - Android

Solution 5 - Android

API Level 29 here. By default the rotate is disabled. Pull Down the drop-down of the mobile and enable it.

Solution 6 - Android

In my case the Skin option in AVD settings was the problem. When I selected "No skin", it worked.

Solution 7 - Android

I had same problem. Try removing the "Keyboard lid support" option in the settings of the hardwere virtual machine. It helped me.

Solution 8 - Android

I made a silly mistake and spent a lot of time for the problem on API 30. Checked Auto-rotate setting and other answers here but tried the rotation on the main Android screen, which is not rotated! You need to open some app (your own or a default one, like 'Messages' or 'Browser') to see the rotation works.
enter image description here

Solution 9 - Android

As of mid 2015 the issue is still open and logged in the android bug tracker here's the link you can check it out https://code.google.com/p/android/issues/detail?id=61671

None of the above solutions worked for me and i am using Android 4.4.2 emulator. As a work around in your graphical layout you can change the orientation and check it out.

Solution 10 - Android

Once you click the change orientation button, a small icon displays on the emulator asking if you want to change the orientation of the emulated screen. It only displays for a few seconds, so look next to the "bottom" icons and you will see this temporary icon.

This works with the emulator keyboard on or off.

I am running Pixel 2 API 29, Android 10.0 (latest versions as at today)

Solution 11 - Android

Is the accelerometer property of the emulator set to True? please check it. if not, set it to true. it should help. its working fine on mine.

> Open AVD Manager -> GoTo 'Device Definitions' tab -> Select an > existing AVD -> Clone

Solution 12 - Android

I had to install a new virtual device Nexus on API LEVEL 27 On Api Level 28(PIE) I could not rotate the display.

And it works for me. Regards enter image description here

Solution 13 - Android

As of API 29, it stops working randomly for no reason. Need to shutdown and restart emulator, then it works again.

Solution 14 - Android

I got this to work with the latest version of AVD.

Check out the config : Android Config for rotate to work

Also, here is the result: AVD result

I think wha tmakes it click is the combination of keyboard and Skin. Also, if you create your own device make sure you add a Gyroscope sensor.

Solution 15 - Android

You have to use Android 5.1.1, aka API 22, aka Android 5.1 LOLLIPOP_MR1. Download Android 5.1.1 (API 22) in your Android SDK Manager and when you create a new Android Virtual Device select that as your OS.

As war_Hero mentioned, this bug was reported to Google. The bug is now fixed as of Mar 23 '15:

https://code.google.com/p/android/issues/detail?id=61671

Solution 16 - Android

In my case you need to click a small button that would enable the orientation to change, right after you press the main change orientation button.

Solution 17 - Android

I had the same problem, I instantly fixed it by simply deleting the device from the AVD list and just creating a new one.

Solution 18 - Android

Only way to get this to work is to use FroYo API AVD

For anyone with this issue, this is how I set up old Froyo AVD to test this scenario:

My Manifest min version is already 8, which is Froyo

< uses-sdk android:minSdkVersion="8" android:targetSdkVersion="21" />

You can see SDK_API_VERSION information here. http://developer.android.com/guide/topics/manifest/uses-sdk-element.html

In the SDK manager Installed the needed version:

http://screencast.com/t/KKZokotI4T

Created a new AVD for the new version.

http://screencast.com/t/W8VN6fOWGW

Solution 19 - Android

On API level 25 (no skin) it worked after going into the setting, searching for "rotate" and toggling both related settings off and on again.

Solution 20 - Android

Pixel 2 - API 28 (Android 9)

I had to do this to fix it.

  • Open AVD Manager
  • Select Pixel 2 - API X
  • Edit
  • Show Advanced Settings
  • Untick "Enable keyboard Input"

Only this has worked for me.

Solution 21 - Android

I am using API29 with Pixel-4 and Android 10.0 on ubuntu-20.04 with React-Native

I tried all the things mentioned here,

  • enabled auto-rotate on mobile.
  • unchecked Hardware keyboard present on AVD.

Unfortunately, it doesn't work for me.

Finally after Restarting my system and expo
$ expo start

# OR

$ npm start

Solution 22 - Android

I had to first press and hold rotate until I got into the menu. Then toggle Auto-rotate screen to true.

enter image description here enter image description here

Solution 23 - Android

When cloning a new virtual device, you have to enable the Accelerometer sensor. But sometimes the configurations are not written to the virtual device's config.ini file properly. Path: \Users\yourusername\.android\avd\virtualdevicename.avd

You have to check the properties and make sure these two properties are set to yes:

hw.accelerometer = yes
hw.sensors.orientation = yes

Open Android Virtual Device Manager Here you will find the device's config.ini file

Edit and save the config.ini file

Solution 24 - Android

I had to do all the following on an Android 10 device:

  1. verify that I had in config.ini:
hw.accelerometer = yes
hw.sensors.orientation = yes
  1. Set the device to auto-rotate from status bar.

enter image description here

  1. Set the home-screen to auto-rotate

Long press at home screen > "Home settings"

enter image description here

"Allow Home screen rotation" set to ON

enter image description here

Solution 25 - Android

For Android Emulator 3.7 WVGA Nexus One I should have down graded the Android Version (it was 11 and i downloaded Pie (9) ), the rotation works now.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJake WilsonView Question on Stackoverflow
Solution 1 - AndroidabidiboView Answer on Stackoverflow
Solution 2 - AndroidDanView Answer on Stackoverflow
Solution 3 - AndroidcprcrackView Answer on Stackoverflow
Solution 4 - AndroidsilvermouseView Answer on Stackoverflow
Solution 5 - AndroidAnastasios DimitriouView Answer on Stackoverflow
Solution 6 - AndroidDino VelićView Answer on Stackoverflow
Solution 7 - AndroidNikolai RiazhskikhView Answer on Stackoverflow
Solution 8 - AndroidArtem MostyaevView Answer on Stackoverflow
Solution 9 - AndroidMightianView Answer on Stackoverflow
Solution 10 - AndroidDavid LipschitzView Answer on Stackoverflow
Solution 11 - AndroidsaranView Answer on Stackoverflow
Solution 12 - AndroidA. TrejoView Answer on Stackoverflow
Solution 13 - AndroidAnton MalyshevView Answer on Stackoverflow
Solution 14 - Androiddrew7721View Answer on Stackoverflow
Solution 15 - AndroidLou MordaView Answer on Stackoverflow
Solution 16 - AndroidRey MontaView Answer on Stackoverflow
Solution 17 - AndroidJohn SmithView Answer on Stackoverflow
Solution 18 - Androiduser3618129View Answer on Stackoverflow
Solution 19 - AndroidTomTascheView Answer on Stackoverflow
Solution 20 - AndroidHoumanView Answer on Stackoverflow
Solution 21 - AndroidMohit PatilView Answer on Stackoverflow
Solution 22 - AndroidJoel BroströmView Answer on Stackoverflow
Solution 23 - Androidcriss_devView Answer on Stackoverflow
Solution 24 - AndroidmadlymadView Answer on Stackoverflow
Solution 25 - AndroidMoriView Answer on Stackoverflow