There is a big chance that you did this within the onCreate() method of the Activity class and you wondered why if with the click of the button, it works.

I read a post from the Stack Overflow forum that the start() method called on the AnimationDrawable cannot be called during the onCreate() method of your Activity because the AnimationDrawable is not yet fully attached to the window.

A good suggestion by user will is to create an inner class where you trigger the start() method of the AnimationDrawable. Try the sample inner class below in your class. It should work.

Related Posts Plugin for WordPress, Blogger...