What Are the Differences Between FLAG_ACTIVITY_RESET_TASK_IF_NEEDED and FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP?

后端 未结 3 537
名媛妹妹
名媛妹妹 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:41

    1) FLAG_ACTIVITY_RESET_TASK_IF_NEEDED

    If some task is pending,than it will destroy that process and will start the activity that you requested

    2) FLAG_ACTIVITY_CLEAR_TOP

    If any previous intent of this activity is running,than this method will deliver the running instance of the activity,close all other activities and will start activity with previous instance.

    3) FLAG_ACTIVITY_SINGLE_TOP

    If recently this activity has been launched,and instance is saved,than it will not launch this activity.

提交回复
热议问题