启动模式允许你定义启动的activity如何和当前任务联系在一起。
Using the manifest file 或者 Using Intent flags (通过startactivt,设置一个flag在intent里)。如果此activity在manifest定义了他的启动模式,而start他的intent也定义了flag
则,intent启动优于他自己本事的定义。
"singleTop"
,the stack is A-B-C-D; D is on top。如果D=standard ,thestack becomes A-B-C-D-D.
if launch mode is "singleTop"
,thestack remains A-B-C-D, but d's onNewintent被调用。如果D不在顶部,则创建一个新的D放到TOP上。
"singleTask"
,如果D没存在与任何一个TASK,则启动一个新的,如果在一个TASK里,即使他不在TOP上,他所在的TASK也被带到前台,而他本身则调用ONNEWINTENT(应该是这样)
FLAG_ACTIVITY_NEW_TASK =
"singleTask"
FLAG_ACTIVITY_SINGLE_TOP =
"singleTop"
FLAG_ACTIVITY_CLEAR_TOP = 如果D存在与一个任务, 则D脑袋上的全部清掉,自己调用ONNEWINTENT.