title: Android: Prevent Orientation to change programmatically
body: <p>I'm using:</p>
  
  <pre><code>setRequestedOrientation(getResources().getConfiguration().orientation);
  </code></pre>
  
  <p>and later on:</p>
  
  <pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED);
  </code></pre>
  
  <p>it prevents the orientation to change until a task is finished, but it only works on portrait, when app is on landscape it doesn't stop orientation to change.</p>
  
  <p>Any suggestions?<br>
  Oim~</p>