I am wondering if decodeResource (Resources res, int id, BitmapFactory.Options opts)
takes into account the drawable-ldpi,mdpi,hdpi etc. folders.
I checked the source code, and it doesn't look like that, but I may be missing something.
(Generally, where are the R.drawable. resolved in Android source? I was unable to find it.)
Yes it takes it into account. For example if you do :
Resources res = getContext().getResources();
int id = R.drawable.image;
Bitmap b = BitmapFactory.decodeResource(res, id);
The bitmap will be different if "image" is present in all of the drawables folders.
So I think using the overloaded method decodeResource (Resources res, int id, BitmapFactory.Options opts)
will work in the same way.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With