How to check if an activity is the last one in the activity stack for an application?

I’m going to post the comment of @H9kDroid as the best answer here for people that have a similar question.

You can use isTaskRoot() to know whether the activity is the root of a task.

I hope this helps

Leave a Comment