title: How to start and stop gif images in android
body: <p>In my application i want to play gif images i am able to play gif images but i want to handle gif images like if i click start button animation should start and if click stop button  animation should stop.</p>
  
  <pre><code>     strtbtn.setOnClickListener(this);
  
        public void onClick(View v) {
          // TODO Auto-generated method stub
          Canvas canvas=new Canvas(mBitmap);
          long now = android.os.SystemClock.uptimeMillis();
          if (mMovieStart == 0) {   // first time
              mMovieStart = now;
          }
          if (mMovie != null) {
              int dur = mMovie.duration();
              if (dur == 0) {
                  dur = 1000;
              }
              int relTime = (int)((now - mMovieStart) % dur);
              mMovie.setTime(relTime);
              mMovie.draw(canvas, mBitmap2.getWidth() - mMovie.width(),
                          mBitmap2.getHeight() - mMovie.height());
        //                invalidate();
              Log.i("movie",""+mMovieStart);
              Log.i("jjhjhhnjhj",""+mMovie);
          }
      }
  </code></pre>
  
  <p>please help me how to start and stop gif animated images.Thanks in advance.</p>