Android: How do I totally remove an Activity from the Activity Stack?

前端 未结 5 1445
梦毁少年i
梦毁少年i 2021-01-07 02:34

I have two Activities FirstActivity and SecondActivity.

FirstActivity has an intent filter MAIN, LAUNCHER and DEFAULT. SecondActivity is just a normal activity and n

5条回答
  •  生来不讨喜
    2021-01-07 02:53

    In Second scenario i think activity stack is empty as app is closed . so now you are starting activity2 , means this is the only activity in stack . now desired back behavior can be possible by overriding onbackpress and start activity1 if its second scenario .

提交回复
热议问题