方法一 overridePendingTransition(0,0)
void android.app.Activity.overridePendingTransition(int enterAnim, int exitAnim)
Call immediately after one of the flavors of startActivity(Intent) or finish to specify an explicit transition animation to perform next.
Parameters:
enterAnim A resource ID of the animation resource to use for the incoming activity. Use 0 for no animation.
exitAnim A resource ID of the animation resource to use for the outgoing activity. Use 0 for no animation.在Activity中提供了overridePendingTransition函数,用在startActivity(Intent) 和 finish之后。overridePendingTransition有两个参数,都是int类型的,意味着这里要传入一个资源。一个是进入的动画,一个是退出的动画,如果连个值都设置成0,则表示不添加动画。
animationdrable资源举例:
android:duration="300"
android:fromXDelta="100%p"
android:toXDelta="0" />
android:duration="300"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
或考虑直接使用安卓自带的动画资源android.R.anim.*
方法二 android:theme
@style/ActivityAnimation
true
@anim/anim_enter
@anim/anim_exit
@anim/back_enter
@anim/back_exit
parent="@android:style/Animation.Activity"不可少,
true可选。
android:theme的使用
android:name="com.tpx.androiddemo.SecondActivity"
android:label="@string/title_activity_second"
android:theme="@style/ThemeActivity" >
原文:http://blog.csdn.net/tpxwantpxwan/article/details/40297137