There are mainly several cases:

1. Click icon to cold start the animation

Set this in onCreate() of the LaunchActivityCopy the code

2.Back key exit animation

Set rootActivity's Finish () to exit the animationCopy the code

3. Re-enter animation from desktop icon after Home button

Observe that launchActivity launch.oncreate () lanucha.finish ()------------> Rewrite the animation needed here xxx.onrestart () xxx.onstart () xxx.onResume() lanuchA.onDestroyed()Copy the code

4. Transitions between pages

Set startActivity startActivities startActivityForResult Finish by overriding the following methodsCopy the code

5. Black screen and white screen in the transition process:

In: startActivity and finish. There is also a delay in creating a new task stack. The reason for the blank screen is that the startActivity animation may be executed before the activity page is drawn, causing the next page to display windowBackground first (usually with a white background), which makes the switching process feel very slow. Black screen cause: even after the above operation, it is obvious that hundreds of milliseconds of black screen can be seen on some poor performance machines. Because there is still an execution time gap between onResume() and onAttachedToWindow(). The amount of time between these views depends on the complexity of the view. Prompt the userCopy the code
It is best to end the previous Activity you want to end after onAttachedToWindow()