user3016075
user3016075

Reputation: 13

android activity to load the old activity instead of creating new instance of that old activity

In My application there are three activities A, B and C and i have kept two buttons in every activity (Previous and Next button) so that user can move from one activity to another. Suppose User is in activity B and user wants to navigate to Activity A.

Here my problem is.. I need to load the old activity instead of creating new instance of Activity A.

Upvotes: 0

Views: 592

Answers (2)

Gabriel Câmara
Gabriel Câmara

Reputation: 1249

Try to call your intent with the flag "BROUGHT TO FRONT"

Intent i = new Intent(...);
i.setFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT);
startActivity(i);

Upvotes: 0

Kuffs
Kuffs

Reputation: 35661

Just call finish on the current activity and the previous one will be shown automatically.

Upvotes: 1

Related Questions