How to track actions in the action stack

I would like to track all the actions in the action stack. Does anyone know how to do this from code?

+4
source share
2 answers

Why do you want to keep track of the action stack ... But there is a way to manipulate the stack using intent flags. Example:

Intent intent=new Intent(this, MainActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(intent); 

This flag will clear all actions from the stack that are present above MainActivity and launch MaintActivity. There are other flags for managing the stack. Hope this helps

0
source

Pretty much what CommonsWare said. Almost any reason for this is incorrect. If you think you need to do this, just stop and ask yourself if this is really necessary. A mess with the activity stack in any way will just annoy the user and create problems for you and for them.

-3
source

All Articles