stop Animation on ImageView - Android User Interface

Android examples for User Interface:ImageView

Description

stop Animation on ImageView

Demo Code


//package com.java2s;
import android.graphics.drawable.AnimationDrawable;
import android.widget.ImageView;

public class Main {
    public static void stopAnimation(ImageView pImageView) {
        AnimationDrawable pAnimation = null;
        if (pImageView != null) {
            pAnimation = (AnimationDrawable) pImageView.getBackground();
        }/*w ww.  j  a  va  2s .  c  o  m*/
        if (pAnimation != null && pAnimation.isRunning()) {
            pAnimation.stop();
        }
    }
}

Related Tutorials