求赐教

解决方案 »

  1.   

    //imageView为xml的控件
    AnimationDrawable mAnimationDrawable = (AnimationDrawable)imageView.getBackground();  
    if(animationDrawable.isRunning()){  
        //可以判断是否结束
    }
      

  2.   

    animationDrawable = (AnimationDrawable) imageView.getBackground();
    animationDrawable.setOneShot(true); imageView.post(new Runnable() { public void run() {
    // TODO Auto-generated method stub
    animationDrawable.start();
    }
    });
    new Thread(new Runnable() { public void run() {
    // TODO Auto-generated method stub
    while (isBoolean) {
    if (animationDrawable != null
    && !animationDrawable.isRunning()) {
    System.out.println(1);
    isBoolean = false;
    }
    }
    }
    }).start();
    都是先输出1再显示动画,求解
      

  3.   

    animationDrawable = (AnimationDrawable) imageView.getBackground();
    animationDrawable.setOneShot(true); imageView.post(new Runnable() { public void run() {
    // TODO Auto-generated method stub
    animationDrawable.start();
    }
    });
    new Thread(new Runnable() { public void run() {
    // TODO Auto-generated method stub
    while (isBoolean) {
    if (animationDrawable != null
    && !animationDrawable.isRunning()) {
    System.out.println(1);
    isBoolean = false;
    }
    }
    }
    }).start();
    都是先输出1再显示动画,求解