How to make Android Buttons show animation on itself when clicked
<p>I'm trying to make a Button that will play a animation-list when pressed.</p>

<p>I have made a animation.xml shown here:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;animation-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
   &lt;item android:drawable="@drawable/one" android:duration="500" /&gt;
   &lt;item android:drawable="@drawable/two" android:duration="500" /&gt;
   &lt;item android:drawable="@drawable/three" android:duration="500" /&gt;
   &lt;item android:drawable="@drawable/four" android:duration="500" /&gt;
&lt;/animation-list&gt;
</code></pre>

<p>Also for the onClick function:</p>

<pre><code>b_button.setBackgroundResource(R.drawable.animation);
AnimationDrawable frameAnimation = (AnimationDrawable) b_button.getBackground();
frameAnimation.setOneShot(true);
frameAnimation.start();
</code></pre>

<p>When I press the button, the animation would be played, however, for just once, after when I press it the second time, it will not play. Furthermore, how do I change the button back to it's original state? Meaning the grey default look of the button.</p>

<p>Any help is appreciated,
Thanks in advance</p>
