title: Is there a way to show splashscreen during onCreate?
body: <p>Maybe it is not the best approach, but my application use <code>onCreate</code> for loading/preparing quite many layouts into <code>ViewAnimator</code>, so after the application start, I have every screen of my app prepared for use. So changing different screens is smooth and fast. </p>
  
  <p>The drawback of this method is, that it takes 5 seconds for the first layout to appear. To be exact - all screens of <code>ViewAnimator</code> are defined in XML layout and I supose they are inflated during <code>onCreate</code>. </p>
  
  <p>My application must have a splashscreen, so my question is, if there is some way to use also these 5 seconds to show some image?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>Thanks to your answers I came up with this simple solution:</p>
  
  <pre><code>Activity activity;
  public void onCreate(Bundle savedInstanceState) 
  {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main_splash);
      activity = this;
      LinearLayout splash_layout = (LinearLayout) this.findViewById(R.id.splash_layout);
  
      // after 1 second of splash screen, start initializing everything
      splash_layout.postDelayed(new Runnable() 
      {   
          public void run() 
          {
              activity.setContentView(R.layout.main);
  
              // Here init whole layout and all class
              // During initialization, the splashscreen is still visible
          }
      }, 1000);
  }
  </code></pre>