Answers for "how to change background color of cardview programmatically in android"

1

get cardview background color programmatically

private val cardView: CardView = itemView.findViewById(R.id.card_view)
cardView.setCardBackgroundColor(ContextCompat.getColor(context, R.color.your_color))
Posted by: Guest on June-20-2021

Code answers related to "how to change background color of cardview programmatically in android"

Browse Popular Code Answers by Language