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
source share