Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Android Activity Lifecycle The Activity Lifecycle Retrieving Instance State

The screen's orientation is not changing

I am using Windows and CTRL + F11 is not rotating the emulator. I manually rotated the emulator using the toolbar but the layout remains in portrait mode. I started a new project and tried rotating the sample Hello World activity, but that also remained in portrait mode.

On android studio version 3.3.2 the rotation shortcuts are CTRL-left arrow and CTRL-right arrow.

I also had the rotation bug where the screen inside the emulator did not actually rotate - the workaround that made it rotate again was disabling "Enable keyboard input" in Android Virtual Device Manager -> The "Edit this AVD" icon in Actions clumn -> Show Advanced Settings.

The issue seems specific for certain device emulations ( like Nexus 5X ) on Nexus 7 tablet it rotated fine without disabling that setting.

2 Answers

Check the auto-rotate setting in the swipe-down notification bar at the top of the virtual phone is enabled.