title: Splash screen wont destoy itself? Java
body: <p>At first my splash screen works perfectly, however later I tried to put in a code which would destroy the activity splash. I did this by putting the onPause method into the end of the protected void.</p>
  
  <p>This is the splash screen before putting in the method</p>
  
  <pre><code>'package com.shipment.emulatorfix;
  
  'import android.app.Activity;
  'import android.content.Intent;
  'import android.media.MediaPlayer;
  'import android.os.Bundle;
  
  'public class Splash extends Activity{
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.splash);
      Thread timer = new Thread(){
          public void run(){
              try{
                  sleep(5000);
              } catch(InterruptedException e){
                  e.printStackTrace();
              }finally{
                  Intent openMain = new Intent("android.intent.action.TESTINGEMULATORACTIVITY");
                  startActivity(openMain);
              }
          }
      };
  timer.start();
  }
  
  
  
  '}
  </code></pre>
  
  <p>this is the after code</p>
  
  <pre><code>'package com.shipment.emulatorfix;
  
  'import android.app.Activity;
  'import android.content.Intent;
  'import android.media.MediaPlayer;
  'import android.os.Bundle;
  
  'public class Splash extends Activity{
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      // TODO Auto-generated method stub
      super.onCreate(savedInstanceState);
      setContentView(R.layout.splash);
      Thread timer = new Thread(){
          public void run(){
              try{
                  sleep(5000);
              } catch(InterruptedException e){
                  e.printStackTrace();
              }finally{
                  Intent openMain = new Intent("android.intent.action.TESTINGEMULATORACTIVITY");
                  startActivity(openMain);
              }
          }
      };
  timer.start();
  }
  
  @Override
  protected void onPause() {
      // TODO Auto-generated method stub
      super.onPause();
      finish();
  }
  
  '}
  </code></pre>
  
  <p>Any help would be greatly appreciated, thank you.</p>