0

I have 3 activities where Activity A start Activity B, and Activity start Activity C.

A <=> B <=> C

So when I go from Activity A to B, I use

this.overridePendingTransition(R.animator.slide_in_left, R.animator.slide_out_right);

From Activity B back to A (using back key eg), it I'll have

this.overridePendingTransition(R.animator.slide_in_right, R.animator.slide_out_left);

Similarly, if I go from Activity B to C, I plan to use

this.overridePendingTransition(R.animator.slide_in_left, R.animator.slide_out_right);

And same for Activity C back to B, I plan to use

this.overridePendingTransition(R.animator.slide_in_right, R.animator.slide_out_left);

Now my problem is activity B has both transition depending it is called by A, or return from C. I create the back transition during onPause(). However this is not idea, as activity B will be paused too when it is calling activity C.

What's the right way (or right place to place the above codes) to controlling the transition animation that depends if it is creating a new activity, or exiting the activity?

Thanks!

Elye
  • 53,639
  • 54
  • 212
  • 474

0 Answers0