找不到符号方法setAnimationListener

时间:2015-11-25 13:32:49

标签: java android animation

我试图让动画在另一个动画结束后运行,在几个论坛中我找到了相同的答案,使用setAnimationListener,但我一直得到找不到符号错误,有什么不对?

public class Juego extends Activity
{
    private AnimationDrawable animacion, loop;
    private MediaPlayer miPlayer;
    private int order = 1;
    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_juego);
    ImageView video = (ImageView)findViewById(R.id.secuencia);
    video.setBackgroundResource(R.drawable.animation_drawable_start);
    animacion = (AnimationDrawable)video.getBackground();
    animacion.start();
    animacion.setAnimationListener(new AnimationListener() {

        @Override
        public void onAnimationStart(Animation animation) {
        }

        @Override
        public void onAnimationRepeat(Animation animation) {

        }

        @Override
        public void onAnimationEnd(Animation animation) {


        }
    });
}

1 个答案:

答案 0 :(得分:3)

AnimationDrawable未提供方法setAnimationListener

AnimationDrawable documentation

您要找的人属于Animation

Animation documentation