I already read articles about that like this one, I achieved that but i have a problem:
I'm trying to do a shared element transition between an Activity and a Fragment:
From my Activity I call a Fragment, When I click on an element of this fragment I want to start the transition from the fragment back to my activity.
I implemented that and is working, for call back my starting activity I'm using:
Intent intent = new Intent(getActivity(), MyActivity.class);
intent.putExtra(TRANSITION_NAME, ViewCompat.getTransitionName(sharedView));
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(), p1, p2);
startActivity(intent, options.toBundle());
The problem is that doing that I'm creating a NEW activity, I just want to call back my old one from where the fragment has been called and do the transition.
How Can I achieve that?