Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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);
like image 680
Houston Avatar asked Jan 09 '13 14:01

Houston


1 Answers

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.

like image 85
Budius Avatar answered Sep 20 '22 14:09

Budius