title: Android: set activity orientation BEFORE onCreate, but not in manifest (HDMI plugged in issue)
body: <p>I can perfectly manage orientation change programatically, by using <code>setRequestedOrientation</code> in <code>onCreate</code>. </p>
  
  <p>Everything works really fine, until I plug a HDMI cable. After this, the tablet "wants" to be in landscape mode. So when I open an activity, it shows first in "landscape" and then right after it shows in "portrait", (because I'm calling <code>setRequestedOrientation(variable_with_orientation_desired_by_the_user)</code> where <code>variable=ActivityInfo.SCREEN_ORIENTATION_PORTRAIT</code> in <code>onCreate</code> As you can "see", my app keeps rotating on every activity the user opens;</p>
  
  <p>If I set the orientantion for activity in the manifest, this problem is partially gone, since the orientation in manifest is the same that the user has picked up. If they are different, the same behavior starts again.</p>
  
  <p>I tried this, but with no success:</p>
  
  <pre><code>@Override
  public void onCreate(final Bundle saved)
  {
      setRequestedOrientation(ScreenOrientation);
      super.onCreate(icicle);
  }
  </code></pre>
  
  <p>So, is there any way to tell to android what orientantion it must create my activity, before it does create it? (But it cannot be in manifest) </p>