Android L setEnterTransition not working

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

@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 in every activity of my project, but it never works. The only animation I get is the “slide effect” below. Am I something wrong here? Should I define anything else, maybe in my layouts or styles.xml?

I hope someone is facing the same problem as me. Thank you very much in advance!

+4
source share
1 answer

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

+7

All Articles