Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid Emulator - Screen orientation does not work properly
    text
    copied!<p>I created a virtual Android device, <code>480x800</code>, ran it, and as I already found how to change the screen <code>orientation</code> (portrait-landscape, <kbd>CTRL+F11</kbd>/<kbd>CTRL+F12</kbd>/<kbd>KP7</kbd>/<kbd>KP9</kbd>), I used these keys to change the <code>orientation</code>.</p> <p>But when I try one of these keys, the virtual screen rotates 90 degrees, but the orientation does not change. Hence, the Buttons are vertically placed on the screen, and all the text too. Just like a picture that is getting rotated 90 degrees.</p> <p>How do I get the virtual degrees to actually switch over to the other layout file <code>(/res/layout-land/activity_entry.xml)</code>? Eclipse's graphical viewer does switching between <code>landscape/portrait</code> correctly.</p> <p><strong>EDIT</strong><br> I added this part in the activity right under this the <code>onCreateOptionsMenu(Menu menu)</code> method, but the application does not recognize screen orientation change:</p> <pre><code>@Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); Context context = getApplicationContext(); CharSequence text = "Orientation changed"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show(); } </code></pre> <p><strong>EDIT 2</strong><br> When I call <code>this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)</code> from within the <code>onCreate()</code> method, it works nicely.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload