title: Android ListView Row Background's causing OutOfMemory Issue
body: <p>I have a fragment which pulls down data from a webservice and displays this in a ListView. I have 10 different selectors which can are used for the Row Backgrounds. The background are repeated once it loops.</p>
  
  <p>The issue I am facing is that the device (Galaxy Nexus!) cannot handle displaying all of these backgrounds. When I set the background via setbackgroundResource the OS is constantly calling the GC to free up memory, which makes the ListView scrolling extremely choppy.</p>
  
  <p>So I tried to cache the Drawables used instead. I see an improvement, but the device will eventually throw an OutOfMemory exception bedcause of how many Drawables are cached. To give an example of how many are cached, I need all 10 selectors which contain two drawables in each, plus a first and last as these are different. This is 24 drawables in memory.</p>
  
  <p>Now, I was thinking it could be the size of the images I am using, and that I need to scale them down and just stretch the proportionally, but im not sure if this will work.</p>
  
  <p>Any suggestions? I have spent a couple of days working on this non-stop, and have not found a viable/close solution.</p>
  
  <p>Thanks</p>
  
  <p>Adam</p>