添加一个动画效果
发现动画没执行完 就直接跳转或者finish掉
添加动画监听事件即可,代码如下:
player.startAnimation(anim); anim.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub finish(); } }); overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out); player.startAnimation(anim); anim.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub finish(); } }); overridePendingTransition(android.R.anim.fade_in,android.R.anim.fade_out);
在onAnimationEnd 添加自己想要的动作就行