我想从布局到布局的动画。我想这个代码,并保存在一个方法即不带我去另一个布局startAnimation没有点击按钮
在这里,我没有得到执行是我的代码
private void showNextScreen() {
Animation animation = AnimationUtils.loadAnimation(context,
R.anim.push_left_in);
animation.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
startActivity(new Intent(context, MainLoginSignUpActivity.class));
finish();
overridePendingTransition(R.anim.push_left_in,
R.anim.push_left_out);
}
});// What to add here "startAnimation(animation);" --> But this shows error how to add it
}
在此之前我是从这个代码
调用此方法context = this;
new CountDownTimer(3000, 1000) {
@Override
public void onFinish() {
showNextScreen();
}
@Override
public void onTick(long millisUntilFinished) {
}
}.start();
请帮忙解决这个问题。在此先感谢
你不要开始你的动画... – njzk2
@ njzk2如何启动动画...我用这种方法试了startAnimation(动画);但它显示错误 – sarabu