How to close an activity without actual finishing?

I want:

open 1, 2, 3 activities 1 > 2 > 3 back to #2 1 > 2 open #4 activity 1 > 2 > 4 back to #2 1 > 2 restore #3 activity 1 > 2 > 3 

Recover means opening previously closed activity without re-creating it. How can i do this?

Thanks!

+4
source share
1 answer
 open 1, 2, 3 activities 1 > 2 > 3 back to #2 1 > 2 // call startActivity for 2, don't call finish() in 3 open #4 activity 1 > 2 > 4 back to #2 1 > 2 restore #3 activity 1 > 2 > 3 // call startActivity for 3 with intent as Intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_To_FRONT); 
+5
source

Source: https://habr.com/ru/post/1415166/


All Articles