You must use the flag for the intent you are using.
Inten Intent i = new Intent(getApplicationContext(), YourActivity.class); //this is what you are looking for i.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(i);
There are many constants for an Intent object, for more information check the tooltip on your IDE when you type the asterisk โFLAG_โ
source share