Setting launchMode=“singleTask” vs setting activity launchMode=“singleTop”

后端 未结 4 1436
天命终不由人
天命终不由人 2020-12-07 19:52

I have an app that is very hierarchical (activities are similar to League > Team > Position > Player) and so I\'ve made each activity singleTop in order to keep

4条回答
  •  被撕碎了的回忆
    2020-12-07 20:42

    I think your definition of singleTop and singleTask is a little off. SingleTop could produce a duplicate instance. Lets use your example, League > Team > Position > Player. If there is a button in the player screen that will take you to the league screen, it will become League > Team > Position > Player > League.

    Whereas singleTask guarantees that only one instance of the activity can exist.

提交回复
热议问题