android API Level 5以后出现了
overridePendingTransition(android.R.anim.slide_in_left,android.R.anim.slide_out_right);
方法重载 切换动画,用法:
Call immediately after one of the flavors of startActivity(Intent)
or finish()
to specify an explicit transition animation to perform next.
android API Level 5之前处理方法:
使用Theme 修改 android:windowAnimationStyle属性
<stylename="AppTheme"parent="android:Theme.Light.NoTitleBar.Fullscreen"> <item name="android:windowAnimationStyle">@style/activityAnimation</item> </style> <stylename="activityAnimation"parent="@android:style/Animation"> <itemname="android:activityOpenEnterAnimation">@anim/push_up_in</item> <itemname="android:activityOpenExitAnimation">@anim/push_down_out</item> <itemname="android:activityCloseEnterAnimation">@anim/push_down_in</item> <itemname="android:activityCloseExitAnimation">@anim/push_up_out</item> </style>
anim分别为自定的动画,可以不会写的同学可以到 Apidemo中找到,或者使用android.R.anim.