never override the default behavior
and instead if you have to do it for a particular activity then the following line is more than enough
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
or after you start activity then call finish();
example
Intent main = new Intent(LoginActivity.this, MainActivity.class);
startActivity(main);
finish();
and instead if you have to do it for a particular activity then the following line is more than enough
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
or after you start activity then call finish();
example
Intent main = new Intent(LoginActivity.this, MainActivity.class);
startActivity(main);
finish();
Comments
Post a Comment