title: Android screen orientation to sensor
body: <p>I want to force the screen orientation to landscape on button click by setting</p>
  
  <pre><code> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
  </code></pre>
  
  <p>It works fine. Now I want the application to follow the sensor so that orientation is brought back to portrait when tilted back to portrait. I know this is possible by setting <code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);</code> but don't know where to set it. If the orientation is forced to landscape, orientation will remain in landscape no matter you tilt in any direction. Can anyone specify how to reset the orientation flag?</p>