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

virsir picture virsir · May 12, 2011 · Viewed 88.4k times · Source

I want to know if user would return to the home screen if he exit the current activity.

Answer

raukodraug picture raukodraug · Mar 27, 2013

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