title: Fastest way to change theme during app startup
body: <p>Currently, I do provide 2 theme in my app, based on user last choice - dark theme and light theme.</p>
  
  <p>During main activity start-up, I will do the following.</p>
  
  <pre><code>public class MyFragmentActivity extends FragmentActivity {
      @Override
      public void onCreate(Bundle savedInstanceState) {
          // getUserLastThemeChoice will either return R.style.Theme_My_Light or 
          // R.style.Theme_My_Dark.
          this.setTheme(getUserLastThemeChoice());
  
          super.onCreate(savedInstanceState);
  </code></pre>
  
  <p>In my <code>AndroidManifest.xml</code>, I have the following</p>
  
  <pre><code>&lt;application
      ...
      android:theme="@style/Theme.My.Dark" &gt;
  </code></pre>
  
  <p>Due to the hard-coded value in <code>AndroidManifest.xml</code>, if user previous choice is light theme, I will observed the following.</p>
  
  <ol>
  <li>App start up with dark theme, due to <code>AndroidManifest.xml</code></li>
  <li>A while...</li>
  <li>App will change to white theme due to <code>this.setTheme</code> in main <code>Activity</code></li>
  </ol>
  
  <p>In there any way I can avoid such transition observation? That's it, just present to user directly, based on their last choice.</p>
  
  <p>p/s Note, it wouldn't help much if you remove the theme information from manifest. As the system is going to use holo dark by default. You will still observe the transition, especially in slow device.</p>