I have a rather weird problem. Everything is working as it should except for this little thing. I'll show the code.
// ...lots of other code
ft.setCustomAnimations(R.animator.slide_in_right, R.animator.slide_out_left, R.animator.slide_in_right, R.animator.slide_out_left);
ft.addToBackStack(null);
// ... some more code
It's pretty simple, when I click a button that replaces a fragment with another fragment an animation between the two is played out. This works dandy! And as you see, the same animation is presented when I press the back button.
It all works! Until... I change orientation. Let's say I'm at the third fragment, change orientation and press the back button, the animation does not play out. The previous fragment is displayed instantly. When I click a menu button again to the third fragment the animations all of a sudden start to work again.
I'm guessing this has something to do with the Bundle, as when you change orientation the Activity is stopped, then started and the savedInstance being "reinserted". However the savedInstance animation was made for portrait and not landscape. Or it's simply just not saving the setCustomAnimations().
Is this a bug or is this how it is supposed to be?