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?