The first one should be the good way, the second one is a dirty hack and not a solution, don't use that code or you end in hell.
But it's here to show the problem. The first code sticks at frame[0] in Android 4 but works well in 5. The second one sets the same drawable as background and as drawable, that results in some references. If I use getBackground to get my object back, I can run play on it and both starts! I guess we need a function like getImageDrawable, to fix it in a better way for Android 4.
I could implement that, if you like. I leave that here for discussion.
The bug exists in Android 4.* as far as I know, it's not reproducible in Android 5.*. It broke in API 15 and 17.
If you put a AnimationDrawable as a drawable to the ImageViewTouch, the animation does only start in Android 5.
I guess it's sort of a timing problem, I could work around by wasting with the object stack.
Example animation-list:
Example code how it works in Android 5 but not in Android 4:
How it actually works in Android 4:
The first one should be the good way, the second one is a dirty hack and not a solution, don't use that code or you end in hell.
But it's here to show the problem. The first code sticks at frame[0] in Android 4 but works well in 5. The second one sets the same drawable as background and as drawable, that results in some references. If I use getBackground to get my object back, I can run play on it and both starts! I guess we need a function like getImageDrawable, to fix it in a better way for Android 4.
I could implement that, if you like. I leave that here for discussion.