开发者

Android: Run Activity from Background

I have some Activities, activity A in which I start new activity B in new Task, so A goes to backgroung with it Task..in B I start C and from C i need to start A...i need to come back to first Task开发者_JAVA百科. How to do that ? Thanks !


Use intents with Intent Flags.

Intent intent= new Intent(CurrentActivity.this, DestinationActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP));

This should be used to start new activity , For example B and C in your case.

and

Intent intent= new Intent(CurrentActivity.this, DestinationActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT));

can be used to relaunch A in your case. Hope this helps.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜