In my Android app, I have the following requirement.
Activity A → Activity B (Go to option A) → Activity C (option "Go to option", "Go to B")
1) To go to activity A from Activity B, I used the onBackPressed() method.
2) To go to step B from Activity C, I used the onBackPressed() method onBackPressed() .
everything is working fine.
3) Now I want to go to Activity A from Activity C (without calling Intent).
How can i do this?
Edited 1:
Activity A is my main activity. I do not want to restart activity using Intent.i to resume action A from action c. (as, for example, I made from operation B using onBackPressed).
Edited 2 (with the answer):
Ok guys. Thank you all for helping me with my question. Finally, I found a simple answer similar to @Paresh Mayani's answer.
Answer:
Intent a = new Intent(getApplicationContext(),ActivityA.class); a.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT); startActivity(a);
I got this nice solution using this link that solved my problem. Thanks to everyone, and I really appreciate that.
source share