TFR TFR - 3 years ago 94
Android Question

How to open already opened activity instead of creating new one?

I have two activities with "navigation menu" which has items for launching Activity1 and Activity2.
For example we starts Activity2 from Activity1 and then we want open Activity1 by tap on "navigation menu", but when we do this we get new instance of Activity1 instead of open Šµxisting instance.
How can i open instance of Activity1 if it already exists and create new instance if not?

Answer Source

Add FLAG_ACTIVITY_REORDER_TO_FRONT to your Intent you use with startActivity().

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download