Start your Activity with Explode Animation
2 min readJul 9, 2019
How to do this?
Let’s say you have two activities.
- MovieDetailActivity
- ImageListActivity
And on click of a Button, this happens.
You can achieve this in 3 simple steps
1) Enable Content Transition
Go to your style.xml and add this line to enable the content transition.
<item name=”android:windowContentTransitions”>true</item>
2) Write Default Enter and Exit Explode Animation for ImageListActivity
3) Start Activity with Intent
Write this method in `MovieDetailActivity` to start `ImageListActivity`
Most important!
put your `setAnimation()`method before `setContentView()` method otherwise the animation will not work.
So your ImageListActivity.java should look like this
And you are done.
Putting up content takes a lot of time and effort 😓.
👏 clap 👏 If you think you learned something from this article.You can find me on Stackoverflow,Github,and,on Linkedin.
Give feedback and feel free to correct mistakes.