stop the following activity if home key or pressed back is pressed - Android
<p>I have a problem and that is my SplashScreen I have. It is built as an intro and after 3 seconds it shows the main menu of the program.
Anyway, if I press down Back or Home button during the time the SplashScreen shows, it closes, but the activity I have chosen to follow after the SplashScreen will still run after the three seconds.</p>

<p>My code: <strong>**<em>UPDATED CODE</em>**</strong></p>

<pre><code>    Handler ur = new Handler();
    myRun = new Runnable() {
            public void run() {     
                    mainIntent = new Intent(SplashScreen.this,MyApp.class);
                    SplashScreen.this.startActivity(mainIntent);
                    SplashScreen.this.finish(); 
                    overridePendingTransition(R.anim.fadein,
                            R.anim.fadeout);    
            }
    };
    ur.postDelayed(myRun, SPLASH_DISPLAY_TIME);
}

protected void onStop() {
    super.onStop();
    ur.removeCallbacks(myRun);
}
</code></pre>

<p>Even if I have an onStop() in this SplashScreen, the next activity will still run after the SPLASH_DISPLAY_TIME. </p>

<p><strong>Since I changed the code I got Force Close after I pressed the Home button and the SplashScreen disappeared, also, I cannot launch my second activity.</strong> </p>
