关于Activity的跳转动画
在1.6之后,也就是从API 5开始,加入了一个overridePendingTransition函数,是用来处理Activity跳转时实现动画效果的。在网上,很多人发帖或者转发,只是很简单的提供了一种写法:
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONUT) { overridePendingTransition(R.anim.push_up_in,R.anim.push_up_out);}public class AnimationModel { private Activity context; public AnimationModel(Activity context){ this.context = context; } /** * call overridePendingTransition() on the supplied Activity. * @param a * @param b */ public void overridePendingTransition(int a, int b){ context.overridePendingTransition(a, b); }}if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.DONU) { (new AnimationModel(Profile.this)) .overridePendingTransition(R.anim.push_up_in, R.anim.push_up_out); }