Display gif on imagebutton android
<p>I was wondering if it is possible to display a gif animation on an image button. I followed the example on Android API BitmapDecode sample and can now display animated gifs on the canvas. </p>

<p>Is it possible to display this same gif on an imagebutton. I tried using the setBackgroundDrawable() and setImageDrawable() but it gives me an empty button.</p>

<pre><code>@Override
 public void onCreate(Bundle icicle) {
    super.onCreate(icicle);
  setContentView(R.layout.test);
  ImageButton btn = (ImageButton) findViewById(R.id.ImageButton01);
  SampleView p=new SampleView(this);

  p.setDrawingCacheEnabled(true);
  p.buildDrawingCache();
      btn.setBackgroundDrawable(p.getBackground());

}
</code></pre>

<p>The SampleView() class is similar to the one provided in the <a href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/BitmapDecode.html" rel="nofollow">BitmapDecode sample</a> (i have removed all other code snippets and it now displays only gif animation)</p>

<p>Thanks,
New Guy.</p>
