frame by frame animation not running
<p>well,i am a newbie to android..and i dont know whats wrong in my code..</p>

<p>this is my xml file</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;  
&lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android" id="selected" android:oneshot="false"&gt;  
    &lt;item android:drawable="@drawable/w1" android:duration="50" /&gt;
    &lt;item android:drawable="@drawable/w2" android:duration="50" /&gt;
&lt;/animation-list&gt;
</code></pre>

<p><strong>my java file</strong></p>

<pre><code>ImageView img = (ImageView)findViewById(R.id.s);
img.setBackgroundResource(R.anim.shape_animation);
</code></pre>

<p><br/></p>

<pre><code>// Get the background, which has been compiled to an AnimationDrawable object.
AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();
</code></pre>

<p><br/>     </p>

<pre><code>// Start the animation (looped playback by default).
frameAnimation.start();
</code></pre>
