title: Set Background Color to MaterialCardView in kotlin?
body: <p>I try to set background color to my MaterialCardView, but I dont have the result that I expected, I tryied with the following ways: </p>
  
  <pre><code>card.setBackground = R.color.red_color
  </code></pre>
  
  <p>I thought because the alpha hex numbers my MaterialCardView shows without background:</p>
  
  <pre><code>card.setCardBackgroundColor(0xB00020)
  </code></pre>
  
  <p>The only way that I can display my cards with color is with this, but the MaterialCardView shows with transparency, if I put for example 0xFFB00020, Android Studio throws me error, because the function expects an Integer, but I can't understand, why my ide throws me error?, if is supposed that I pass hexadecimal number as param: </p>
  
  <pre><code>card.setcardBackgroundColor(0x79B00020)
  </code></pre>
  
  <p>This is my code: </p>
  
  <pre><code> override fun onBindViewHolder(holder: TableHolder, position: Int) {
          if (position &lt; tableList.size) {
              val table = tableList[position]
              val node = holder.table
              //Log.e("NODE", node.toString())
              holder.guestNumber.text = table.people.toString()
              holder.tableName.text = table.description
              if (node is MaterialCardView) {
                  when (table.status) {
                      "A" -&gt; {
                          holder.descriptionTable.text = "ABIERTA"
                          node.setCardBackgroundColor(0xFF7903DAC6)
                      }
                      "D" -&gt; {
                          holder.descriptionTable.text = "DISPONIBLE"
                          node.setCardBackgroundColor(0x79CA4B02)
                      }
                      "C" -&gt; {
                          holder.descriptionTable.text = "CERRADA"
                          node.setCardBackgroundColor(0x79FF0266)
                      }
                      else -&gt; {
                          holder.descriptionTable.text = node.context.getString(R.string.error_label)
                          node.setCardBackgroundColor(0x79B00020)
                      }
                  }
              }
          }
      }
  </code></pre>
  
  <p>The first case throws me error for the 0xFF...</p>
  
  <p><strong>EDIT</strong></p>
  
  <p><strong><em>I Found the solution!</em></strong>
  For set background color to MaterialCardView in Kotlin is necessary parse the hexadecimal value to Int, for example: <code>0xFFCA4B02.toInt()</code>
  But someone can explain me why this is necessary in kotlin?</p>
  
  <p>I hope someone can help me, regards.</p>