I have two Activities A1 and A2. A1 has a fragment F1 and A2 has a fragment F2. When the user clicks on the fragment F1, it calls Activity A2 which has fragment F2 loaded by default. This is the flow. Now I have a shared view between fragments f1 and f2. I followed this link to implement the shared element transition and it works, but only sometimes. The shared element transition across fragments is not consistent. The return transition happens as expected but the enter transition doesn't always work.
Where am I going wrong? Where should I set setSharedElementEnterTransition()
and setSharedElementReturnTransition()
?