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();
        }/*from   ww  w  . j  a v a  2  s. co m*/
        if (pAnimation != null && pAnimation.isRunning()) {
            pAnimation.stop();
        }
    }
}

Related Tutorials