Activity启动模式系列(四)singleTop启动模式

如何查看栈内的activity?

答:使用  adb shell dumpsys activity activities 命令

------------------------------------------------------------------------------

singleTop如果不是在Top堆叠,而是隔一个会怎么样呢?

使用上面的命令查看:

 Running activities (most recent first):
      TaskRecord{aa1a95 #10170 A=calc.superdy.ttest U=0 StackId=1 sz=14}
        Run #13: ActivityRecord{f56e408 u0 calc.superdy.ttest/.Test3 t10170}
        Run #12: ActivityRecord{a7e2684 u0 calc.superdy.ttest/.Test2 t10170}
        Run #11: ActivityRecord{ab6cdc0 u0 calc.superdy.ttest/.Test1 t10170}
        Run #10: ActivityRecord{860b5bc u0 calc.superdy.ttest/.MainActivity t10170}
        Run #9: ActivityRecord{c1e7a78 u0 calc.superdy.ttest/.Test4 t10170}
        Run #8: ActivityRecord{31177f4 u0 calc.superdy.ttest/.Test3 t10170}
        Run #7: ActivityRecord{3d5ca30 u0 calc.superdy.ttest/.Test2 t10170}
        Run #6: ActivityRecord{3e4d2c u0 calc.superdy.ttest/.Test1 t10170}
        Run #5: ActivityRecord{fd09ce8 u0 calc.superdy.ttest/.MainActivity t10170}
        Run #4: ActivityRecord{f011564 u0 calc.superdy.ttest/.Test4 t10170}
        Run #3: ActivityRecord{f2ed2a0 u0 calc.superdy.ttest/.Test3 t10170}
        Run #2: ActivityRecord{35fb09c u0 calc.superdy.ttest/.Test2 t10170}
        Run #1: ActivityRecord{5bc4b58 u0 calc.superdy.ttest/.Test1 t10170}
        Run #0: ActivityRecord{a0b0780 u0 calc.superdy.ttest/.MainActivity t10170}

 

可以看出来如果不是top叠加top,则singleTop和standard没有区别

 

你可能感兴趣的:(安卓)