Android: Control goes back to Splash Screen -


i have designed app splash screen sleep() s 3 seconds , displays home screen of app. can navigate app seamlessly , after come home screen, when button pressed control goes splash screen again instead of terminating app. please give me solution. :)

finish splash activity before starting new one. onresume method of splash activity this:

@override protected void onresume() {     super.onresume();      new handler().postdelayed(new runnable() {         @override         public void run() {             // finish splash activity can't returned             splashactivity.this.finish();             // create intent start second activity             intent mainintent = new intent(splashactivity.this, secondactivity.class);             splashactivity.this.startactivity(mainintent);         }     }, 3000); // 3000 milliseconds } 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -