title: How to change screen orientation from outside of activity?
body: <p>I have searched a lot and found screen orientation can be changed from activity class by using the following code:</p>
  
  <pre><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);  
  setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
  </code></pre>
  
  <p>But my requirement is to change the screen orientation from outside of an activity like from an <strong>AsyncTask</strong>. So please tell me if it is possible to do so or is there any alternate way of doing this.</p>