title: How to center-crop layout background programatically
body: <p>I'm setting the background of a layout programmatically. How do I center-crop the background?</p>
  
  <pre><code>Bitmap bm = BitmapFactory.decodeFile(myUri);
  BitmapDrawable dw = new BitmapDrawable(bm);
  layout.setBackgroundDrawable(dw); 
  </code></pre>
  
  <p><strong>edit</strong></p>
  
  <p>I am looking for the Java equivalent of <code>android:scaleType="centerCrop"</code></p>