I have some custom class BitmapStorage, not attached to any View or whatever - an utility one.
And i have born_animation.xml file which contains <animation-list> with animation frames.
I want to load it as an AnimationDrawable using Resources class (so it would do all the parsing for me), extract Bitmaps and put them to my custom storage class.
The problem i have:
- Code: Select all
Resources res = context.getResources();
AnimationDrawable drawable = (AnimationDrawable)res.getDrawable(R.drawable.born_animation);
assertTrue( drawable != null ); <= fails! it's null
WTF? Can someone explain me that? Code compiles fine. All resources are in place.
I tried another way - use ImageView to do the parsing (like described in dev guide)
- Code: Select all
ImageView view = new ImageView(context);
view.setBackgroundResource(R.drawable.born_animation);
AnimationDrawable drawable = (AnimationDrawable)view.getBackground();
assertTrue( drawable != null ); <= fails! it's null
Results are the same. it returns the null drawable.
Any hinsts would be greatly appreciated, thanks in advance


