I am working on animating an element between two activities using code like this:
Pair<View, String> pair1 = Pair.create(sharedView, transitionName);
Pair<View, String> pair2 = Pair.create(sharedBackgroundView, transitionBackgroundName);
ActivityOptionsCompat transitionActivityOptions = ActivityOptionsCompat.makeSceneTransitionAnimation(MainActivity.this, pair1, pair2);
startActivity(myIntent, transitionActivityOptions.toBundle());
This works great when I`m using phone's back button to get back tot the initial activity, but when I use back button from the Action Bar the transition animation is no longer present. I there any work around for it?
The problem can be seen in the following clip, first time I use phone on screen back button and second time I use Back button form the Action Bar.