Traverse between activities in stack

前端 未结 2 702
梦毁少年i
梦毁少年i 2021-01-18 14:51

Suppose I have activity instances A1, B1, A2, B2, C1 of activities A, B, C in stack. How can I traverse to Activity instance B1 from C1?

Let us generalize there will

2条回答
  •  花落未央
    2021-01-18 15:25

    Use Flags with Intent.

    official Docs: https://developer.android.com/guide/components/tasks-and-back-stack.html

    pass the flag along with Intent

    FLAG_ACTIVITY_CLEAR_TOP

    also you can paas multiple FLags in a single Intent according to your need.

    Hope this helps.

提交回复
热议问题