1

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?

GMX
  • 950
  • 1
  • 14
  • 29
  • Possible duplicate of [Best practice to reference the parent activity of a fragment?](https://stackoverflow.com/questions/13116104/best-practice-to-reference-the-parent-activity-of-a-fragment) – Matias Fuentes Apr 07 '19 at 21:37
  • 1
    I don't need the context of my activity, I need to close the fragment and run the shared element transition returning in the old activity – GMX Apr 07 '19 at 22:01

0 Answers0