title: App using libgdx restarts whenever device rotates
body: <p>I made an app using accelerometer but problem is whenever it detects rotation of the screen, it goes to main menu. </p>
  
  <p>I used following code to disable rotation but it still detects the rotation action and goes to mainmenu although it does not become landscape mode anymore.</p>
  
  <pre><code>    if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) {
          setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
      }
  </code></pre>
  
  <p>How can I prevent this rotation detection?</p>