Here is the situation:
I am using child fragment introduced with API 17. Say I have
ActivityA -> FragmentA
ActivityA -> FragmentB
FragmentA -> ChildFragmentA
FragmentA -> ChildFragmentB
So I'm on ActivityA->FragmentA->ChildFragmentA
and I transition to ActivityA->FragmentA->ChildFragmentB
with a FragmentTransaction using animations for adding to the backstack and popping the backstack (there is an animation when I go to ChildFragmentB and an animation when I press back and move to ChildFragmentA).
Now I navigate to ActivityA->FragmentB
(FragmentA is no long attached). When I navigate back to ActivityA->FragmentA
where ChildFragmentB
is visible, ChildFragmentB
animates in as it did when coming from ChildFragmentA
.
I want to disable this animation when resuming Activity->FragmentA
. But keep it when transitioning between the children fragments. This animation is set in the FragmentTransaction. Is there any way to make this happen?
ft.setCustomAnimations(FragmentTransaction.TRANSIT_NONE, FragmentTransaction.TRANSIT_NONE);
for when you don't want any transition. I'm not sure where you're specifying your FragmentTransaction so I don't know if this works for you. – SvenT23