title: Android change windowBackground programmatically on application start
body: <p>I'm well conscious how to set the <em>splash</em> of an activity in Android using the theme in manifest and the tag <em>windowBackground</em>.</p>
  
  <p>A client recently showed up asking to "change the splash screen accordingly to some events during the day". 
  I'm almost sure that it cannot be done, but I decided to give it a shot with this code:</p>
  
  <pre><code>public class MyApplication extends Application {
  
      @Override
      public void onCreate() {
          super.onCreate();
  
          int random = (int) Math.abs(System.currentTimeMillis() % 3);
  
          switch (random) {
  
              case 0:
                  setTheme(R.style.FullscreenTheme1);
                  break;
  
              case 1:
                  setTheme(R.style.FullscreenTheme2);
                  break;
  
              default:
                  setTheme(R.style.FullscreenTheme3);
                  break;
          }
      }
  }
  </code></pre>
  
  <p>Obviously this isn't working.</p>
  
  <p>Someone already tried to accomplice this or has a better idea?</p>
  
  <p>Thank you</p>
  
  <p>EDIT:</p>
  
  <p>Create a fake activity or fragment to show as splash screen will be easy, but will left that unpleasant white (or black depending on the theme) flash at the application start.</p>
  
  <p>This question is about feasibility of changing the splash screen programmatically with the same result as hardcoding it up in the manifest.</p>