title: Android: manual screen orientation without restarting the activity?
body: <p>I need to make an app playing video with a button for full-screen on the video. The button is used to manually switch between landscape and portrait of the video display. We don't want the auto rotation detect. So the Manifest file is set as below.</p>
  
  <pre><code>&lt;activity
      android:name=".VideoActivity"
      android:screenOrientation="portrait"
      android:configChanges="keyboardHidden"/&gt;
  </code></pre>
  
  <p>I used </p>
  
  <p><code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);</code> or <code>setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);</code> </p>
  
  <p>to manually set the orientation. It works but it restarts the activity - the onCreate() was found called. So the video playback restarts from the beginning unexpectedly. I cannot make it smooth as like as using <code>onConfigurationChanged()</code> - the auto rotation detect method.</p>
  
  <p>So how to make manual screen orientation change without restarting the activity?</p>
  
  <p>Thank you.</p>