我正在尝试从布局到布局的动画。我尝试了这段代码并保存在一个方法中,但我没有被执行,即它没有把我带到另一个布局
这是我的代码
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();
请帮助解决这个问题。提前致谢