On shared views, set android:transitionName="@string/transition_detail"
in both first and second activity. Then launch the second activity like this:
ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(
getActivity(),
mSourceView,
getString(R.string.transition_detail));
Intent intent = new Intent(getActivity(), SecondActivity.class);
ActivityCompat.startActivity(getActivity(), intent, options.toBundle());