What Are the Differences Between FLAG_ACTIVITY_RESET_TASK_IF_NEEDED and FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP?

后端 未结 3 534
名媛妹妹
名媛妹妹 2020-12-02 06:15

I am in the process of (finally) writing the chapter on tasks for my book, and I am encountering a few lingering puzzles.

Things that serve as home screen launchers s

3条回答
  •  离开以前
    2020-12-02 06:18

    I might be mistaken here, but in my understanding FLAG_ACTIVITY_NEW_TASK | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED does analyze all tasks and makes sure that only one task with launcher activity is running.

    FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP will inspect current task only, so you might end up with 2 launcher instances running at the same time (if the first one was created as a separate task).

提交回复
热议问题