@Override
public void startActivity(Intent intent) {
super.startActivity(intent);
overridePendingTransition(R.anim.in_from_right, R.anim.anim_no);
}
@Override
public void finish() {
super.finish();
overridePendingTransition(R.anim.anim_no, R.anim.out_to_right);
}
问题:当调用startActivity打开下一个activity时调用finish关闭当前activity,动画会失效,如果不调用finish关闭当前activity,动画就不会失效
原因:动画抵消了
解决:调用finish后,还需要调用overridePendingTransition(R.anim.anim_no, R.anim.anim_no);去掉关闭时的动画