title: Cardview Set Background color
body: <p>I am trying to change the Cardview background color dynamically in the Bindview holder of RecylerView like this.</p>
  
  <pre><code>holder.cardView.setCardBackgroundColor(R.color.LightCyan);
  </code></pre>
  
  <p>The strange thing is the background is applying the almost opposite of the applied color.(#E0FFFF-LightCyan) to 1F0000 -Almost Black)</p>
  
  <p>I had verified few colors here <a href="http://www.colortools.net/color_complementary.html" rel="noreferrer">here</a> and the result is same.</p>
  
  <p>But if I set like this </p>
  
  <pre><code>holder.cardView.setCardBackgroundColor(ContextCompat.getColor(this.mContext, R.color.LightCyan));
  </code></pre>
  
  <p>It worked perfectly.(Yes it's the correct way to set).</p>
  
  <p>CardView XML:</p>
  
  <pre><code>&lt;android.support.v7.widget.CardView
      android:id="@+id/cv"
      android:foreground="?selectableItemBackground"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"&gt;
  </code></pre>
  
  <p>OS : Android 6.0 HTC</p>
  
  <p>But where is the understanding gap here?</p>