Android: Clear the back stack

前端 未结 30 2202
被撕碎了的回忆
被撕碎了的回忆 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条回答
  •  滥情空心
    2020-11-22 07:33

    Add NO History Flag in the intent.

    In activity B, start the activity C as below >>>>>>

    Intent intent = new Intent(this, C.class);
    intent.setFlags(intent.getFlags() | Intent.FLAG_ACTIVITY_NO_HISTORY); 
    startActivity(intent);
    finish();
    

提交回复
热议问题