Houston
Houston

Reputation: 437

Android stop FragmentTransaction animation

Any idea on how I can stop the fade animation when invoking replace as below?

    FragmentManager     fm          = activity.getFragmentManager();
    FragmentTransaction transaction = fm.beginTransaction();

    transaction.replace(Id,Fragment,Tag);

Upvotes: 5

Views: 5092

Answers (1)

Budius
Budius

Reputation: 39846

simple:

 transaction.setCustomAnimations(0,0);

You can also use this method to set any custom animation you want, by passing a reference to R.anim. resource.

Upvotes: 5

Related Questions