@Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    GifMovieView gif1 = new GifMovieView(this);
    gif1.setMovieResource(R.drawable.gif_heart);
    setContentView(gif1);
  }
 public void onGifClick(View v) {
   GifMovieView gif = (GifMovieView) v;
   gif.setPaused(!gif.isPaused());
 }