I have tried every sample of code I can find that defines and runs a frame animation, but the ImageView never changes. The original Image in the ImageView stays.
EDIT: After many days of trial and error, I ran the APK on my phone instead of the emulator. It works on my phone, but for some reason it does not on the emulator.
Want to add a comment to schwiz answer.
I was able to get it working from calling the Handler.post from a worker thread. Below is the sample.
I struggled with it some time as well. It is explained in android frame animation tutorial, but let's say with "small letters". Let me copy the answer from there:
It is at the very bottom of http://developer.android.com/guide/topics/graphics/view-animation.html#frame-animation
I am not exactly clear why you can't start animations from the onCreate thread, they need to be posted to whatever thread the handler of the view was created on.
I have no idea why you need to do this but you do.
edit:Here is snippets from my working project should be everything you need...
in java in onCreate:
in xml layout:
coin xml: