title: Change the background color of CardView programmatically
body: <p>The <a href="https://developer.android.com/reference/android/support/v7/widget/CardView.html" rel="noreferrer">CardView</a> has an attribute <code>card_view:cardBackgroundColor</code> to define the background color.
  This attribute works fine.</p>
  
  <p>At the same time there isn't a method to change the color dynamically.</p>
  
  <p>I've just tried solutions like:</p>
  
  <pre><code>mCardView.setBackgroundColor(...);
  </code></pre>
  
  <p>or using a Layout inside the cardView</p>
  
  <pre><code>   &lt;android.support.v7.widget.CardView&gt;
          &lt;LinearLayout
              android:id="@+id/inside_layout"&gt;
      &lt;/android.support.v7.widget.CardView&gt;  
  
   View insideLayout = mCardView.findViewById(R.id.inside_layout);
   cardLayout.setBackgroundColor(XXXX);
  </code></pre>
  
  <p>These solutions don't work because the card has a cardCornerRadius.</p>