title: Does Android cache drawable resources loaded in xml layout files?
body: <p>I have a <code>ViewPager</code> which loads lots of fragments (+20). Each one of these fragments is just an instance of one single fragment, and the only thing that changes is the content of each one. The UI for this fragment has, among other widgets, 4 different <code>ImageViews</code> which all load the same resource drawable but are of course located in different parts of the UI.</p>
  
  <p>Now, if we take into account that I might have for example 20 fragments with this scheme, we're talking about 80 (20*4) ImageViews which would all load the same drawable.</p>
  
  <p>So, that made me wonder, does Android cache in any way resources that are loaded from xml layouts? If not, is there a better option then simply loading this drawable in code, caching it and attaching it programmatically to their corresponding ImageView every time a new instance of this fragment gets created?</p>
  
  <p>Thanks.</p>