When we are used:
Intent intent = new Intent(origin, MainActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
origin.startActivity(intent);
Activity time to clear the stack, each Activity will not go inside finish()
, which leads before you use this method to empty stack, we must first consider whether there Activity in finish what has been done very important things (such as is run a Service, is make an important, time-consuming sub-thread operations)