Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Activity Stack

How to see if the next time I press the back (hardware) button, will take me on the screen. My question is basically: Is there a way to see the size of the Activity Stack (API level 7).

like image 513
BurunduK Avatar asked Mar 15 '11 16:03

BurunduK


1 Answers

boolean Activity.isTaskRoot(); Since: API Level 1

Return whether this activity is the root of a task. The root is the first activity in a task.

Just don't do it in onCreate() as the calling activity may not have finish()ed itself yet.

like image 141
Marcus Wolschon Avatar answered Sep 25 '22 07:09

Marcus Wolschon