I have a code snippet to show you below and I am trying to change view's(v) background. I'll get color code from a TextView
(dragged) and change View
(v)'s background by using this code. But I get an error as indicate above. How can I fix it? Where is the problem? Thanks.
ColorDrawable cd = (ColorDrawable)dragged.getBackground();
int colorCode = cd.getColor();
v.setBackgroundColor(colorCode);