N久不写东西了,总是以太忙为借口 :(
Android中两个启动模式的不同点,解释的非常好
In a simple way-
singleTask:
The system creates a new task and instantiates the activity at the root of the new task. However, if an instance of the activity already exists in a separate task, the system routes the intent to the existing instance through a call to its onNewIntent() method, rather than creating a new instance. Only one instance of the activity can exist at a time.
Note: Although the activity starts in a new task, the Back button still returns the user to the previous activity.
singleInstance-
Same as "singleTask", except that the system doesn't launch any other activities into the task holding the instance. The activity is always the single and only member of its task; any activities started by this one open in a separate task.
来自:
http://stackoverflow.com/questions/3219726/android-singletask-or-singleinstance-launch-mode
本文详细解释了Android中两种启动模式singleTask和singleInstance的区别。singleTask模式下,系统会在新任务中创建活动实例,如果已有实例则直接复用并调用onNewIntent()方法。singleInstance模式与singleTask类似,但其所在的任务不允许包含其他活动。
4653

被折叠的 条评论
为什么被折叠?



