Disable the orientation change
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/1512045/how-to-disable-orientation-change-in-android">How to disable orientation change in Android?</a>  </p>
</blockquote>



<p>I want to disable orientation change after opening the canvas in any orientation(portrait or landscape) , but I am having problem when open the canvas in the landscape mode and change the device orientation, the orientation is not disabled. </p>

<p>here is the code .</p>

<pre><code>public void onConfigurationChanged(Configuration newConfig) {

  super.onConfigurationChanged(newConfig);
  this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);

}
</code></pre>
