user1312837
user1312837

Reputation: 1298

how to close activity without actually finishing?

I want to:

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

"Restore" means open previously closed activity without re-creating. How can i do that?

Thanks!

Upvotes: 5

Views: 1100

Answers (1)

Shrikant Ballal
Shrikant Ballal

Reputation: 7087

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);

Upvotes: 6

Related Questions