I'm inserting Fragments into the Activity using this code:
FragmentTransaction transaction = getFragmentManager().beginTransaction();
MyFragment myFragment = new FMyFragment();
transaction.setCustomAnimations(R.anim.fade_in, R.anim.fade_out);
transaction.replace(R.id.DetailsFragment, myFragment, ForumCreateFragment.FRAG_TAG);
transaction.addToBackStack(null);
transaction.commit();
The custom transition animation is a simple fade in/out animation. It's displaying correctly when I just add this same type of Fragment multiple times.
But when I pop the fragment-backstack with the back button, it flashes in the previous fragment, fades it away, and leaves a blank area, displaying nothing - even if there are more elements on the backstack. It seems that popping the stack causes the transition animations to play backwards. What am I doing wrong?