title: Looping frame by frame animation
body: <p>I'm trying to get my animation to run only 6 times, I set the <strong><code>oneshot="true"</code></strong> and tried to loop the animation but it doesn't work, the animation still runs only once. </p>
  
  <p>Any help is much appreciated. </p>
  
  <p><strong>Here is the code</strong></p>
  
  <pre><code>&lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android"  android:oneshot="true"&gt;
    &lt;item android:drawable="@drawable/image" android:duration="100" /&gt;
    &lt;item android:drawable="@drawable/image1" android:duration="100" /&gt;
    &lt;item android:drawable="@drawable/image2" android:duration="100" /&gt;
    &lt;item android:drawable="@drawable/image3" android:duration="100" /&gt;
    &lt;item android:drawable="@drawable/image4" android:duration="100" /&gt;
   &lt;/animation-list&gt;
  </code></pre>
  
  <p>.</p>
  
  <pre><code>    for (int i = 0; i &lt; 5; i++){
          img.setBackgroundResource(R.anim.anime);
          AnimationDrawable frameAnimation = (AnimationDrawable)img.getBackground();
          frameAnimation.setCallback(img);
          frameAnimation.setVisible(true, true);
          frameAnimation.start();
     }
  </code></pre>