super.onResume();
ImageView imageView = (ImageView) findViewById(R.id.imageview);
InputStream is = getResources().openRawResource(R.raw.animated);
FrameSequence fs = FrameSequence.decodeStream(is);
mDrawable = new FrameSequenceDrawable(fs, mProvider);
mDrawable.setOnFinishedListener(new FrameSequenceDrawable.OnFinishedListener() {
@Override
public void onFinished(FrameSequenceDrawable drawable) {
Toast.makeText(getApplicationContext(),
"THE ANIMATION HAS FINISHED", Toast.LENGTH_SHORT).show();
}
});
imageView.setImageDrawable(mDrawable);