I have an Activity A from there I open Activity B, and pass the shared element to it. It animates the transition fine, but when I go back to Activity A and then go to Activity B again which is still in the stack using
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
The shared element transition is not run.
With regular animations you call overridePendingTransition() in onNewIntent for the animations to run. https://stackoverflow.com/a/8327091
I tried calling startPostponedEnterTransition() in there but nothing happened.
This is my code to allow for transitions
void allowWindowTransitions(){
Window w = getWindow();
w.requestFeature(Window.FEATURE_ACTIVITY_TRANSITIONS);
Code to start activity
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
ActivityOptionsCompat options = ActivityOptionsCompat.
makeSceneTransitionAnimation(this, sharedElement, "profile");
startActivity(intent, options.toBundle());
I have tried messing around with setSharedElementReturnTransition & setSharedElementReenterTransition but nothing happened.
Is there a way trigger shared element transition manually to get around this.