title: How to pause and resume an animation?
body: <p>I have a circular Imageview that I can start rotating it by clicking the button but I want to press the button again when it stops in that position. How can I do this?</p>
  
  <p>this is <code>Animation</code></p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt; 
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:interpolator="@android:anim/linear_interpolator"&gt;
      &lt;rotate
          android:fromDegrees="0"
          android:pivotX="50%"
          android:pivotY="50%"
          android:toDegrees="360"
          android:duration="10000"
          android:repeatCount="infinite"
          android:repeatMode="restart" /&gt;
   &lt;/set&gt;
  </code></pre>
  
  <p>this is <code>MainActivity</code></p>
  
  <pre><code>Animation cd1;
  ImageView imageview;
  Button button1;
  
  cd1 = AnimationUtils.loadAnimation(this, R.anim.cd_player1);
  
  button1.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  imageview.startAnimation(cd1);
                  }
              }
          });
  </code></pre>
  
  <p>Thank !</p>