title: Show .gif with android.graphics.Movie
body: <p>I'm trying, create a view with an animated GIF..</p>
  
  <p>When i try run the follow code in emulator all works fine. But when i try run in real Smart Phone, nothing happens.. </p>
  
  <p>My view:</p>
  
  <pre><code>public class GIFView extends View {
  
  private Movie mMovie;
  private long movieStart;
  
  public GIFView(Context context) {
      super(context);
      initializeView();
  }
  
  public GIFView(Context context, AttributeSet attrs) {
      super(context, attrs);
      initializeView();
  }
  
  public GIFView(Context context, AttributeSet attrs, int defStyle) {
      super(context, attrs, defStyle);
      initializeView();
  }
  
  private void initializeView() {
      InputStream is = getContext().getResources().openRawResource(
              R.drawable.cookies2);
      mMovie = Movie.decodeStream(is);
  }
  
  protected void onDraw(Canvas canvas) {
      canvas.drawColor(Color.TRANSPARENT);
      super.onDraw(canvas);
      long now = android.os.SystemClock.uptimeMillis();
  
      if (movieStart == 0) {
          movieStart = (int) now;
      }
      if (mMovie != null) {
          int relTime = (int) ((now - movieStart) % mMovie.duration());
          mMovie.setTime(relTime);
          mMovie.draw(canvas, getWidth() - mMovie.width(), getHeight()
                  - mMovie.height());
          this.invalidate();
      }
  }}
  </code></pre>
  
  <p>My activity:</p>
  
  <pre><code>public class MainActivity extends Activity {
      public void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       GIFView gifView = new GIFView(this);
       setContentView(gifView);
  }}
  </code></pre>
  
  <p>My Smartphone screenshot:
  <img src="https://i.stack.imgur.com/5brPg.png" alt="My Smartphone screenshot">
  My emulator screenshot:
  <img src="https://i.stack.imgur.com/mOlHC.png" alt="My emulator screenshot"></p>
  
  <p>Why my app doesn't run in smartphone? </p>