Java tutorial
//package com.java2s; import android.graphics.drawable.AnimationDrawable; import android.widget.ImageView; public class Main { public static void startFrameAnimation(ImageView targetImageView, int animationDrawableId) { if (targetImageView == null || animationDrawableId <= 0) { return; } targetImageView.setImageResource(animationDrawableId); AnimationDrawable animationDrawable = (AnimationDrawable) targetImageView.getDrawable(); animationDrawable.start(); } }