09:42:21
Reprinted from: http://blog.csdn.net/liuhe688/article/details/6754323 #
This is the clearest article about launchMode.
Write your own things:
1. An application exits by pressing back and opens it again. At this time, the value of getTaskId (), that is, the Task ID, will change, :-). I didn't pay attention to it before;
2. For SingleTask, if you declare it again, all the Activity instances on the corresponding Activity will go out of the stack and change it to the top object of the stack;
3. singleInstance:
Open Activity (launchmode = singleInstance) in application B, press the Home Key to exit, open application A, and find that the Activity is the same Task ID.
Open Activity (launchmode = singleInstance) from A, press Home to exit, open application B, and then open Activity (launchmode = singleInstance) in A from B ), it is found that the Activity is still the same Task ID.
ActivityA enables ActivityB, ActivityB uses SingleInstance, and ActivityB opens ActivityC. It is found that ActivityA and ActivityC are in the same stack, and ActivityB is in another stack. When returning ActivityC to ActivityA, press and return, to ActivityB.
Download the test code. If you are interested, you can change the code by yourself:
Http://files.cnblogs.com/wlrhnh/4_lauchmode.zip