title: How to get image from drawable-xhdpi
body: <p>I try make my application support multiple density. As we know if we want to get value of density we use syntax like this "getResources().getDisplayMetrics().density;".</p>
  
  <p>My question is how to get picture from some folder. let say i have a variable :</p>
  
  <pre><code>    float myDensity = getResources().getDisplayMetrics().density;
  </code></pre>
  
  <p>when myDensity return 1.0 , I want take picture from drawable-mdpi, when it return 0.75 i want to take picture from drawable-ldpi, and same with picture in folder drawable-xhdpi, and folder drawable-xxhdpi. i try to make it like this
  <code>treepict.setImageResource(R.drawable-hdpi.tree);</code> but that i get just error.</p>
  
  <p>anyone can help me how to do this?</p>