title: Android CardView setBackground as BitmapDrawable when API <21
body: <p>I have a problem when I am trying to <code>setBackground()</code> of a <code>CardView</code> programatically in KitKat.When the application is running on Android L there is no problem in my code :</p>
  
  <pre><code>Drawable drawable = new BitmapDrawable(appContext.getResources(), bitmap);
  if (cardView != null) {                
      cardView.setBackground(drawable);
  }
  </code></pre>
  
  <p>But when it runs in API older than Android L I get this error: <code>android.graphics.drawable.BitmapDrawable cannot be cast to android.support.v7.widget.RoundRectDrawableWithShadow.</code></p>
  
  <p>I found out that this is known issue and there is work around where you want to set a colour as a background of the card, but is there any solution with which I could set the bitmap for background programatically? Do you have any idea how could I create <code>RoundRectDrawableWithShadow</code> from my <code>BitmapDrawable</code>?</p>