title: How to lock screen orientation in reverse portrait and reverse landscape mode
body: <pre><code>int currentOrientation = getResources().getConfiguration().orientation;
          if (currentOrientation == Configuration.ORIENTATION_PORTRAIT) {
              setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
          } else if(currentOrientation == Configuration.ORIENTATION_LANDSCAPE){
              setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
          }
  </code></pre>
  
  <p>This is the code is used for locking screen orientation programatically. But it is not working for reverse portrait and reverse landscape. What could be the solution.</p>