开发者

how to call an activity of a task from an activity of another task

If, there is an activity task with activities

A1 -> A2

and another activity task with activities

B1 -> B2

The requirement is, From B2 I need to call A2, but no new instance of A2 开发者_JAVA百科must be created, it should be loaded from the stack (A2 which is in top of the first task)

Now when I press back button from A2 I need to get A1?

How to implement this?


Have you read Tasks and Back Stack?

There is an option for activity:
"singleTask"
The system creates a new task and instantiates the activity at the root of the new task. However, if an instance of the activity already exists in a separate task, the system routes the intent to the existing instance through a call to its onNewIntent() method, rather than creating a new instance. Only one instance of the activity can exist at a time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜