Android: Clear the back stack

前端 未结 30 2182
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 06:47

In Android I have some activities, let\'s say A, B, C.

In A, I use this code to open B:

Intent intent = new Intent(this, B.class);
startActivity(inte         


        
30条回答
  •  萌比男神i
    2020-11-22 07:43

    I found the answers here a little misleading because the code in the original question seems to work fine for me?

    With A being the root activity, starting it from B or C only with FLAG_ACTIVITY_CLEAR_TOP does remove B and C from the back stack.

提交回复
热议问题