I was wondering, is there a difference memory-whise between defining an animationdrawable in xml and making the animationdrawable dynamically in your code?
Asked
Active
Viewed 179 times
0
-
no difference, after all if you define it in xml it has somehow to be created into AnimationDrawable – pskink Apr 08 '15 at 11:42
-
I know, but still, xml files are 'static'.. But thanks for the reply! – Matty De Bie Apr 08 '15 at 11:54
-
what does it mean: static? see AnimationDrawable sources and find inflate() method, you will see that addFrame() is used inside for adding every frame definded in xml file – pskink Apr 08 '15 at 11:59
-
Ok, if that's the case than you're right.. It's just animation drawables are very slow in loading.. – Matty De Bie Apr 08 '15 at 14:33
-
so copy its code and do custom Bitmap loading.. – pskink Apr 08 '15 at 14:38
1 Answers
0
Because there was no answer I could accept, here is what was said (and what's right).
There is no difference between making an AnimationDrawable in xml or dynamically in code. Android's framework will dynamically create the AnimationDrawable in the background if you made it in xml.

Matty De Bie
- 111
- 9