Jim
Jim

Reputation: 9234

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. How to do that ? Thanks !

Upvotes: 0

Views: 3707

Answers (1)

Tushar Vengurlekar
Tushar Vengurlekar

Reputation: 7679

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.

Upvotes: 1

Related Questions