Android - Clearing Navigation Backstack

后端 未结 3 1124
隐瞒了意图╮
隐瞒了意图╮ 2021-01-20 18:34

I have 4 pages.

From page_1 > page_2 > page_3 > page_4.

Once the user reaches page_3 and clicks a button, it navigates to page_4. Once the button is clicked

3条回答
  •  灰色年华
    2021-01-20 18:46

    for all the other activities like page_3,page_2,page_1,

    Use FLAG_ACTIVITY_NO_HISTORY(If set, the new activity is not kept in the history stack.) :

    intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
    

提交回复
热议问题