Here is the block code which is set colour of any view background. it’s use hex code value to set color for example like “#ffffff” this is hex code of white colour.

Code

_view.setBackgroundColor(Color.parseColor(“hex code here”));

This code set the background color of any view. in this code replace _view to your view id. “hex colour code” replace with the hex code of colour what you want.