0

I want to know how to pause and restart animations. I followed this code, but it's not working for me:

animRight = AnimationUtils.loadAnimation(this, R.anim.move_right1);
            animRight.setDuration(3000);
            mTv1.setVisibility(TextView.VISIBLE);
            mTv1.setBackgroundResource(R.drawable.hand);
            animRight.setAnimationListener(this);
            mTv1.startAnimation(animRight);

// override methods 

    @Override
    public void onAnimationEnd(Animation animation) {
// when animations is finished 
 }

    @Override
    public void onAnimationStart(Animation animation) {
// when animations is start
 }

    @Override
    public void onAnimationRepeat(Animation animation) {
// when animations is repeated  
 }

Here I want to pause and restart the animation. How do I do this?

Brian Willis
  • 22,768
  • 9
  • 46
  • 50
sravan
  • 5,303
  • 1
  • 31
  • 33

2 Answers2

0

Animation do not have a pause method

From the API : Package android.view.animation

Check out the comment on a way to go about this.

Community
  • 1
  • 1
SteD
  • 13,909
  • 12
  • 65
  • 76
0

There is no pause method.You can go for implementing postDelayed.

Android Killer
  • 18,174
  • 13
  • 67
  • 90
  • i know pause method not avilable in animation , is there any other way to implement pause and restart – sravan Aug 18 '11 at 05:10