title: How to start Android animation from the values where it was stopped?
body: <p>I have an image view on which I apply a rotate animation. The animation works fine. On touch down, I attempt to stop the rotate animation using cancel(), resetting the animation using reset() and clearing the animation on the view using clearAnimation(). But the animation comes back to the original position. How to stop animation with the values it was when touch down event happens and restart from where it was stopped?</p>
  
  <p>My animation is defined in the xml as below</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;rotate xmlns:android="http://schemas.android.com/apk/res/android"
      android:fromDegrees="360"
      android:toDegrees="0"
      android:pivotX="50%"
      android:pivotY="50%"
      android:fillAfter="true"
      android:fillEnabled="true"
      android:duration="200000"
      android:repeatMode="restart"
      android:repeatCount="infinite"
      android:interpolator="@android:anim/linear_interpolator"/&gt;
  </code></pre>
  
  <p>I am attempting to stop the animation using the following code</p>
  
  <pre><code>private void stopAnimation(){
          mRotateAntiClockwiseAnimation.cancel();
      mRotateAntiClockwiseAnimation.reset();
      imageView.clearAnimation();
      mRotateAntiClockwiseAnimator.end();
      mRotateAntiClockwiseAnimator.cancel();
      stopAnimationForImageButton();
      }
  </code></pre>
  
  <p>I am setting the animation on my view using the following code</p>
  
  <pre><code>mRotateAntiClockwiseAnimation = AnimationUtils.loadAnimation(context, R.anim.rotate_anticlockwise);
          mRotateAntiClockwiseAnimation.setFillEnabled(true);
          mRotateAntiClockwiseAnimation.setFillAfter(true);
          imageView.setAnimation(mRotateAntiClockwiseAnimation);
          mRotateAntiClockwiseAnimation.startNow();
          imageView.invalidate();
  </code></pre>
  
  <p>As u see, even using cancel() or reset() did not help to stop the animation at the point where it was touched down. Any pointers would help</p>