Does android backlinks load from resource?

So, I have several ImageViews in one action, and they all use the same bitmap image from the resource.

ImageViewOne.setImageResource(R.drawable.frequently_used_image); ImageViewTwo.setImageResource(R.drawable.frequently_used_image); ImageViewThree.setImageResource(R.drawable.frequently_used_image); 

Does android collect memory to load a bitmap once and reuse it for all other ImageViews using the same resource? Or does it load a bitmap every time it is set to ImageView?

Thanks!

+4
source share
1 answer

Quote from Dianne Hackborn from the Android team:

Also keep in mind that Resources already has a Drawables cache for you using this mechanism, so you do not need to implement your own cache for any Drawables that you retrieve from resources.

from this answer: Consequences drawable.setCallback (null);

+5
source

Source: https://habr.com/ru/post/1486133/


All Articles