title: I want to set an animated image in my application
body: <p>I want to set an animated image in my application.i use an animation-list to show it frame by frame but it's  not working!!
  please help me!! </p>
  
  <p>here is Java code</p>
  
  <pre><code>_imagView=(ImageView)findViewById(R.id.imageView1);
  _imagView.setBackgroundResource(R.drawable.anim);
  AnimationDrawable anim1 = (AnimationDrawable) _imagView.getBackground();    
  anim1.start();
  </code></pre>
  
  <p>and here is anim.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android"
  android:oneshot="false"&gt;
  &lt;item android:drawable="@drawable/animationchoking0" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking1" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking2" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking3" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking4" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking5" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking6" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking7" android:duration="500" /&gt;
  &lt;item android:drawable="@drawable/animationchoking8" android:duration="500" /&gt;
  &lt;/animation-list&gt;
  </code></pre>