Android examples for User Interface:ImageView
start Animation on ImageView
//package com.java2s; import android.graphics.drawable.AnimationDrawable; import android.widget.ImageView; public class Main { public static void startAnimation(ImageView pImageView, AnimationDrawable pAnimation, int resId) { if (pImageView != null && pAnimation == null) { pImageView.setBackgroundResource(resId); pAnimation = (AnimationDrawable) pImageView.getBackground(); }/*from ww w . j ava2s .com*/ if (pAnimation != null && !pAnimation.isRunning()) { pAnimation.start(); } } }