People who know about Android programming should know that after Android 2.0 there is a overridependingtransition () with two parameters, one for the previous activity, and another for the activity entry.
The following code:
@Override Public voidonCreate (Bundle savedinstancestate) {Super. OnCreate (savedinstancestate); Setcontentview (R.layout.splashscreen); NewHandler (). postdelayed (NewRunnable () {@Override Public voidrun () {Intent mainintent=NewIntent (SplashScreen. This, Androidnews.class); SplashScreen. This. StartActivity (mainintent); SplashScreen. This. Finish (); Overridependingtransition (r.anim.zoomin,r.anim.zoomout); } }, 3000); }
First, create the Anim folder under the Res folder, and then put the animated XML file inside.
Zoomin.xml
<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android"Android:interpolator= "@android: Anim/decelerate_interpolator"> < Scaleandroid:duration= "@android: Integer/config_mediumanimtime"Android:fromxscale= "2.0"Android:fromyscale= "2.0"Android:pivotx= "50%p"Android:pivoty= "50%p"Android:toxscale= "1.0"Android:toyscale= "1.0" /></Set>
Zoomout.xml
<?XML version= "1.0" encoding= "Utf-8"?><Setxmlns:android= "Http://schemas.android.com/apk/res/android"Android:interpolator= "@android: Anim/decelerate_interpolator"android:zadjustment= "Top"> < Scaleandroid:duration= "@android: Integer/config_mediumanimtime"Android:fromxscale= "1.0"Android:fromyscale= "1.0"Android:pivotx= "50%p"Android:pivoty= "50%p"Android:toxscale= ". 5"Android:toyscale= ". 5" /> <Alphaandroid:duration= "@android: Integer/config_mediumanimtime"Android:fromalpha= "1.0"Android:toalpha= "0" /></Set>
Android implementation activity page jump Toggle animation effect