Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screen orientation landscape back to portrait not working

Tags:

I've racked my brain for hours over this issue. I have created a main.xml and designed one for the res/layout-land (landscape) format and another one for portrait in res/layout.

When I rotate the emulator (ctrl-F11), my app rotates properly to landscape using the correct main.xml, but a subsequent rotation back to portrait just keeps the landscape mail.xml.

This was done in a 2.0 AVD..

Out of despiration I downloaded the new Sample Code for Multiple Resolutions and had to create a new 2.1 AVD, to my surprise rotation with this app works correctly as expected. So I then decided to try my app on the 2.1 AVD and it works perfectly.

So, is this a Bug in a 2.0 AVD or is there something special I need to be doing for < 2.1 SDK versions?

This is driving me crazy because no where did anyone mention this issue.

Thanks in advance

like image 295
Marc Avatar asked Mar 20 '10 03:03

Marc


People also ask

Why won't my screen rotate back?

If the screen rotation is already on try turning it off and then on again. To check this setting, you can swipe down from the top of the display. If it's not there, try going to Settings > Display > Screen rotation.

Why is my Iphone stuck in landscape mode?

Swipe down from the top-right corner of your screen to open Control Center. Tap the Portrait Orientation Lock button to make sure that it's off.


2 Answers

FWIW, it's officially reported as bug here.

like image 54
yacoob Avatar answered Sep 20 '22 17:09

yacoob


Installed a fresh Android development environment, and created a new 2.3.3 AVD. (Both arm and x86). Both have the same problem, even with the system apps. So it's not a bug in your code, cause the system apps have the same problem.

Pressing 'home' and restarting your app works to get it back to portrait though.

like image 23
Joris Mak Avatar answered Sep 20 '22 17:09

Joris Mak