Problem with Landscape
<p>Use a folder layout-land and layout-port them is a copy main.xml.</p>

<pre><code>    public void onSensorChanged(SensorEvent e) {
        if (event.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {

            if(event.values[0] &gt;= 8)
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

            else            
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        }
</code></pre>

<p>When you switch the screen is the establishment of two layers on each other. I use <code>android:configChanges="orientation|keyboardHidden"</code>
Help me please if you can give an example. I would be very grateful.</p>
