如何杀死子活动,并把活动堆栈的顶部堆栈、并把

2023-09-12 04:15:40 作者:白洋花海、你回眸一笑。

我有一个启动活动B的启动活动C活性的

I have activity A that starts activity B which starts activity C

A - > B - > C

A -> B -> C

当用户点击的活动℃的按钮,我想带一个堆栈的顶部,并采取B和;下完全出栈。有没有办法做到这一点? ?

When a user clicks on a button in activity C, i want to bring A to the top of the stack and take B & C completely out of the stack. Is there a way to do this ? ?

推荐答案

您可以使用FLAG_ACTIVITY_CLEAR_TOP标志的意图重新启动活性的。

You can use the FLAG_ACTIVITY_CLEAR_TOP flag on the intent to restart activity A.