Calling
overridePendingTransition(R.anim.transition_to_right, R.anim.transition_to_left);
after finish(); of the closing activity worked for me.
finish();
overridePendingTransition(R.anim.transition_to_right, R.anim.transition_to_left);
It's better than calling onResume, because it makes the activity more independent about the enter and exit animations:
Calling after finish of sender activity:
Activity A ---Enter Transition 1 (on A)---> Activity B ---Enter Transition 2 (on B)---> Activity C
Activity A <---Exit Transition 1 (on B)--- Activity B <---Exit Transition 2 (on C)--- Activity C
Activity A ---Enter Transition 1 (on A)---> Activity C ---Enter Transition 3 (on C)---> Activity B
Activity A <---Exit Transition 3 (on C)--- Activity C <---Exit Transition 2 (on B)--- Activity B
Calling on onResume of receiver activity:
Activity A ---Enter Transition 1 (on B)---> Activity B ---Enter Transition 2 (on C)---> Activity C
Activity A <---Enter Transition 1 (on A)--- Activity B <---Enter Transition 2 (on B)--- Activity C
Activity A ---Enter Transition 3 (on C)---> Activity C ---Enter Transition 2 (on B)---> Activity B
Activity A <---Enter Transition 1 (on A)--- Activity C <---Enter Transition 3 (on C)--- Activity B
Here the onResume animation always have to be the same no matter which sender activity it is, instead the first approach, where you can custom the animation easily.