Clear Activity on Android stack, which will not go finish each Activity

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)

Published 248 original articles · won praise 99 · Views 100,000 +

Guess you like

Origin blog.csdn.net/rikkatheworld/article/details/103011214