Restart - Clear stack Android

1

The stack of a mobile application, once it arrives at the "Home", starting with the "start", once I have made a number of activities, which would be the right thing to do:

Send it back to HOME by means of intents , or have to do a go back until the home, the stack is restarted or cleaned once a start attempt is made or the only How to get out of the stack is going backwards? , is there any method to clean the stack?

Thanks in advance

    
asked by Bruno Sosa Fast Tag 10.01.2018 в 14:17
source

1 answer

1

If I understand well, you want to remove the previous stored activities from the stack.

There is a flag that you can pass to the Intent when you go to the Home.

Intent intent = new Intent(getApplicationContext(), Home.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(intent);
    
answered by 11.01.2018 / 00:44
source