I have a splash screen activity, then a login activity. My history stack looks like:
SplashActivity LoginActivity
when the user successfull
Just do this to clear all previous activity in a task:
finishAffinity() // if you are in fragment use activity.finishAffinity() Intent intent = new Intent(this, DestActivity.class); // with all flags you want startActivity(intent)