5

When I tried to use transitions with fragments using similar code from this article on Medium GitHub. It wouldn't work when I am using the add method() on fragment manager but it would work with replace().

FragmentManager fragmentManager = getSupportFragmentManager();
    fragmentManager.beginTransaction()
            .addSharedElement(mSharedElement, "transName")
            .add(D.id.content_frame, fragment, FRAG_NAME)
            .addToBackStack(null)
            .commit();

I need to use add() method to keep the fragment below as the user will be navigating back and forth between the first fragment which contains a list of items and the second fragment show detailed info about the item. I don't want to keep loading the fragment with the list again.

Is there a way to get shared element transitions to work when using add() on the fragment manager, than replace().

pt123
  • 2,146
  • 1
  • 32
  • 57
  • 1
    Possible duplicate of [shared element transition works with FragmentTransaction.replace() but doesn't work with FragmentTransaction.add()](http://stackoverflow.com/questions/29145031/shared-element-transition-works-with-fragmenttransaction-replace-but-doesnt-w) – kuelye Feb 03 '16 at 09:34

0 Answers0