I’m trying to place some animation in my app.
I’m using an ImageView and set my xml animation as background.
In the activity I use
ImageView iv = (ImageView)findViewById(R.id.its_party_time_view);
AnimationDrawable ad = (AnimationDrawable) iv.getBackground();
ad.start();
to start the animation.
It works fine on HTC Evo 3D that runs 4.0.3,
but on a Samsung Galaxy that runs 2.3.3 it just shows one image.
As I can see, all the functions that I’m using should work starting API 1.
Whats the problem in my code?
This post seems to suggest that it’s a bug in earlier versions and you can work around it by calling ad.start() in a new thread.
https://stackoverflow.com/a/11385114/603412