Avoid splash screen activity when pressing Back button
In your AndroidManifest.xml
file, add android:noHistory="true"
attribute in your splash screen <activity>
.
As I understand, you want the splash activity to not show after changing activity. You should note activities save On Stack and with starting new activity push on it and with finish you pop on top stack. I think that if you the call finish()
method your problem fix as in your splash screen activity where you call StartActivity insert finish()
after
public void onClick(View v) {
Intent intent = new Intent(Main.this, Splash.class);
startActivity(intent);
finish();
}
Hope to be useful :)
You can just call
finish();
In your Splash screen when you jump to the second screen.