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!
onPause() for current activity will be called before you go to myActivity, where onCreate() gets called. Now if you press back button, myActivity's onPause() gets called, and you move back to activity A, where onResume() is called.
Using activity. isFinishing() is the right one solution. it return true if activity is finished so before creating dialog check for the condition.
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);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With