Reputation: 2935
I am launching an About Activity with overridePendingTransition()
right after it, so I can get an animation of the incoming Activity.
I want the Activity to perform an animation as well upon "leaving", so I have overriden onBackPressed()
and it works ok.
The problem comes, as the About activity has the "Up navigation" enabled, on how to perform the animation when the "Up" navigation is tapped --instead of just Back button-- to return to previous activity.
I have tried
@Override
public boolean onNavigateUp() {
overridePendingTransition(R.anim.fadeinltr, R.anim.fadeoutltr);
return super.onNavigateUp();
}
but it does not work, because by the time the overridePendingTransition()
method is called, there is no transition to override yet.
Any ideas?
Upvotes: 0
Views: 837
Reputation: 46
I had the same problem and I solved in this way:
@Override
public boolean onNavigateUp(){
boolean x = super.onNavigateUp();
overridePendingTransition(R.anim.slide_in_right, R.anim.slide_out_right);
return x;
}
Upvotes: 1