I have an Activity which sets the exit transition as Explode, like this: (API >= 21)
...
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (VERSION.SDK_INT >= VERSION_CODES.LOLLIPOP) {
getWindow().requestFeature(Window.FEATURE_CONTENT_TRANSITIONS);
getWindow().setExitTransition(new Explode());
}
setContentView(R.layout.activity_test);
...
}
...
When I start another Activity like this:
startActivity(intent,ActivityOptions.makeSceneTransitionAnimation(this).toBundle());
the explode transition appears. How ever, I want to play the explode transition when I press the back button(which finishes the activity), but it doesn't work out as I expected.
So is the exit transition just for entering the next Activity or what? What if the Activity is the leaf Activity(which starts no other Activity) in my app?
And:
- What should I do to play the explode transition when the leaf Activity is finishing?
- What should I do if I want to play a shared element transition to its parent Activity, but not the way in reverse?