github地址:https://github.com/xiaoliang0227/android_launchMode_demo

Android有四种启动模式,分别为standard、singleTop、singleInstance、singleTask。设置启动模式可以在AndroidManifest.xml中设置Activity的launchMode属性,Activity的默认启动模式为standard。所以,如果想设置Activity为standard模式可以不用给launchMode设置属性值。

ActivityRecord{2bdeacf4 u0 com.zyl.demo.launchmode/.activity.SingleTaskModeActivity t35}]

ActivityRecord{2048d3ac u0 com.zyl.demo.launchmode/.activity.SingleTaskModeActivity t36}]

singleInstance模式跳转实例:

ActivityRecord{233b107 u0 com.zyl.demo.launchmode/.activity.StandardModeActivity t39},

ActivityRecord{1d3013cc u0 com.zyl.demo.launchmode/.activity.SingleTopModeActivity t39}]

Task id:#40

Activities=[

ActivityRecord{2229e7be u0 com.zyl.demo.launchmode/.activity.SingleInstanceModeActivity t40}]

04-17 06:28