title: Playing a animated gif as a Movie only display canvas background
body: <p>I would like to play an animated gif in my Android application.</p>
  
  <p>I noticed that a WebView works fine with this code:</p>
  
  <pre><code>webview.loadUrl("file:///android_asset/gif.gif");
  </code></pre>
  
  <p>Unfortunately, the webView is too memory intensive and my app often crash.</p>
  
  <p>I have seen a lot of tutorials using Movie like this one:</p>
  
  <pre><code>public class GIFView extends View {
      private Movie movie;
      private long moviestart;
  
      public GIFView(Context context) throws IOException {
          super(context);
          movie = Movie.decodeStream(getResources().getAssets().open("gif.gif"));
      }
  
      public GIFView(Context context, AttributeSet attrs) throws IOException {
          super(context, attrs);
          movie = Movie.decodeStream(getResources().getAssets().open("gif.gif"));
      }
  
      public GIFView(Context context, AttributeSet attrs, int defStyle)
              throws IOException {
          super(context, attrs, defStyle);
          movie = Movie.decodeStream(getResources().getAssets().open("gif.gif"));
      }
  
      private long _start_time;
  
      @Override
      protected void onDraw(Canvas canvas) {
          canvas.drawColor(Color.RED);
          super.onDraw(canvas);
  
          long _current_time = android.os.SystemClock.uptimeMillis();
          if (0 == _start_time) {
              _start_time = _current_time;
          }
          if (null != movie) {
              final int _relatif_time = (int) ((_current_time - _start_time) % movie
                      .duration());
              movie.setTime(_relatif_time);
              Log.i("",""+_relatif_time);
              double scalex = (double) this.getWidth() / (double) movie.width();
              double scaley = (double) this.getHeight() / (double) movie.height();
              canvas.scale((float) scalex, (float) scaley);
               movie.draw(canvas, (float) scalex, (float) scaley)
          }
  
          this.invalidate();
      }
  }
  </code></pre>
  
  <p>As I get a big red window, I can see that Canvas is drawn, and with the Log I added, I can see that my movie is not null and has a length!</p>
  
  <p>Unfortunately, nothing appear in the canvas except the big red rectangle, and I have tested with different gif files.</p>
  
  <p>Any idea why this is not working?</p>