title: How to implement splash screen in android
body: <p>I have a application which shows list of items. i need to display a fadeout image before start of main activity.
  i tried something like that
  in onCreate method of main activity i started
  one animation activity like</p>
  
  <pre><code>Intent animationIntent=new Intent(this,AnimationActivity.class);
  startActivityForResult(AnimationIntent);
  </code></pre>
  
  <p>in onCreate method of AnimationActivity.class</p>
  
  <pre><code>super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
      ImageView introanim = (ImageView) findViewById(R.id.imgView);
      AnimationSet StoryAnimation = (AnimationSet)AnimationUtils.
  loadAnimation(this, R.anim.alphanim);
  StoryAnimation.setAnimationListener(new AnimationListener() {
  
          @Override
          public void onAnimationStart(Animation animation) {
              // TODO Auto-generated method stub
  
          }
  
          @Override
          public void onAnimationRepeat(Animation animation) {
                  AnimationSubActivity.this.finish();
  
          }
  
          @Override
          public void onAnimationEnd(Animation animation) {
              AnimationSubActivity.this.finish();
          }
      });
  
      introanim.clearAnimation();
      introanim.startAnimation(StoryAnimation);
  </code></pre>
  
  <p>and my main.xml is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  &gt;
  &lt;ImageView  
  android:id="@+id/imgView"
  android:layout_width="fill_parent" 
  android:layout_height="fill_parent" 
  android:src="@drawable/icon"
  /&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>problem with this approach is that it display an amimation but imageview come to screen for a while and main activity comes with slide transition effect </p>
  
  <p>but i want i image fade out and my activity should fade in</p>
  
  <p>any help will be appreciated. Thanks in advance</p>