Home » Android » How can I finish all activities in current Android task?

How can I finish all activities in current Android task?

Posted by: admin May 14, 2020 Leave a comment

Questions:

Is it possible to finish all activities in current Android task?

How to&Answers:

It was already asked here.
But basically there’s no such function… Maybe you could keep a collection of all the activities and finish them yourself, but I doubt that’s good practice.
Or if all your activities are in the same “stack” you could try the answer given by “user370305”.

Answer:

There is another alternative. Whole application could be done using fragments with single activity. FragmentManager provide full control over fragments and it is possible to finish all of them.