Error when calling method setRequestedOrientation()
<pre><code>public void onSensorChanged(SensorEvent e) {
    if (e.sensor.getType()==Sensor.TYPE_ACCELEROMETER) {

        if(e.values[0] &gt;= 8)
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        else
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
    }
}
</code></pre>

<p>When the method is called setRequestedOrientation() - error. Create layout-land and placed there a copy of the main.xml file.</p>
