Code example for AnimationDrawable

Methods: start

0
                    fixedStar.setX(randfrange(0, getWidth())); 
                    fixedStar.setY(randfrange(0, getHeight())); 
                    final AnimationDrawable anim = (AnimationDrawable) fixedStar.getDrawable(); 
                    postDelayed(new Runnable() {  
                        public void run() { 
                            anim.start(); 
                        }}, (int) randfrange(0, 1000)); 
                } 
            } 
 
            for(int i=0; i<NUM_CATS; i++) { 
                FlyingCat nv = new FlyingCat(getContext(), null); 
                addView(nv, wrap); 
                nv.z = ((float)i/NUM_CATS); 
                nv.z *= nv.z; 
                nv.reset(); 
                nv.setX(randfrange(0,Board.this.getWidth())); 
                final AnimationDrawable anim = (AnimationDrawable) nv.getDrawable(); 
                postDelayed(new Runnable() {  
                    public void run() { 
                        anim.start();