Reputation: 11931
I have a fragment with list view on it. When the user clicks on any of the list view's items he/she is transferred in an Activity. The default animation of the activity that is started (startActivity from the fragment -> opens this activity) is from the bottom slide to top of the screen. How I can override this animation and create a slide from right animation when the activity is created.
I have tried to override the overridePendingTransition method in the activity but that did not change anything.
@Override
public void overridePendingTransition(int enterAnim, int exitAnim) {
super.overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
}
Upvotes: 4
Views: 1237
Reputation: 10316
From the Activity.overridePendingTransition documentation :
Call immediately after one of the flavors of startActivity(Intent) or finish() to specify an explicit transition animation to perform next.
In other words, call the method on the current Activity after starting the new Activity, instead of overriding it.
Upvotes: 3