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
  • 21,082
  • 9
  • 45
  • 50
sravan
  • 5,165
  • 1
  • 30
  • 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,711
  • 12
  • 63
  • 74
0

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

Android Killer
  • 17,747
  • 12
  • 64
  • 88
  • 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