title: Android Activity Splash Screen
body: <p>I have a splash screen which displays for 2-3 sec before it disappears.
  I want to add a Fade in Effect when the next activity is loaded. I saw an Example in the Facebook Hacker Example and i am using it.
  It uses a finish(); to end that activity to so from the DashboardActivity if some one clicks back it doesnt return back to the SplashAcitivty. But using this doesnt create the Fade in Effect as show in the API demos Examples.</p>
  
  <pre><code>public class SplashActivity extends Activity {
      private long splashDelay = 3000;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
  
          // Remove title bar
          this.requestWindowFeature(Window.FEATURE_NO_TITLE);
  
          // Remove notification bar
          /*
           * this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
           * WindowManager.LayoutParams.FLAG_FULLSCREEN);
           */
  
          setContentView(R.layout.activity_splash);
  
          TimerTask task = new TimerTask() {
  
              @Override
              public void run() {
                  finish();
                  startActivity(new Intent().setClass(SplashActivity.this,
                          MainActivity.class));
                  overridePendingTransition(R.anim.fade, R.anim.hold);
              }
          };
  
          Timer timer = new Timer();
          timer.schedule(task, splashDelay);
  
      }
  
  }
  </code></pre>