title: How can I fix GradientDrawable cannot be cast to ColorDrawable issue?
body: <p>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 <code>TextView</code>(dragged) and change <code>View</code>(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.</p>
  
  <pre><code>ColorDrawable cd = (ColorDrawable)dragged.getBackground();
      int colorCode = cd.getColor();
      v.setBackgroundColor(colorCode);
  </code></pre>