Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android L setEnterTransition not working

I'm currently trying to use the new transition animations in Android 5.0. I started as suggested by many Tutorials:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
    getWindow().setEnterTransition(new Explode());
    getWindow().setExitTransition(new Explode());
    setContentView(R.layout.activity_quiz);
    getActionBar().setTitle("Java Skill");
    getActionBar().setElevation(2);
}

I put this code into every activity of my project but it never works. The only animation I get is the "slide in effect" from the bottom. Am I doing something wrong here? Do I have to define anything else, maybe in my layouts or styles.xml?

I hope anyone ran into the same problem as me. Thanks very much in advance!

like image 804
Fabian Avatar asked Mar 17 '23 19:03

Fabian


1 Answers

The documentation may be wrong. You need to enable FEATURE_ACTIVITY_TRANSITION.

like image 146
George Mount Avatar answered Mar 29 '23 01:03

George Mount