title: java.lang.ClassCastException: android.graphics.drawable.LayerDrawable cannot be cast to android.graphics.drawable.GradientDrawable
body: <p>In my application I am trying change background color for each listView item. And for that I am using shapes which in layer-list. 
  Here is my code</p>
  
  <p>drop_shadow.xml</p>
  
  
  
  <pre><code>&lt;layer-list xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;item&gt;
          &lt;shape android:shape="rectangle"&gt;
  
              &lt;gradient android:startColor="#B7B7B7"
                        android:endColor="#A1A1A1"
                        android:angle="270"/&gt;
              &lt;corners android:radius="10dp" /&gt;
  
          &lt;/shape&gt;
      &lt;/item&gt;
  
      &lt;item android:top="1px"&gt;
  
          &lt;shape android:shape="rectangle"&gt;
  
              &lt;solid android:color="@color/color11"/&gt;
              &lt;corners android:radius="10dp" /&gt;
          &lt;/shape&gt;
  
      &lt;/item&gt;
  
  &lt;/layer-list&gt;
  </code></pre>
  
  <p>main.xml</p>
  
  <pre><code>&lt;RelativeLayout 
                  android:orientation="vertical"
                  android:id="@+id/mainLayout"
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:background="@drawable/drop_shadow"/&gt;
  </code></pre>
  
  <p>When I call this method I have ClassCastException</p>
  
  <pre><code> private void setRoundedBackground(View view,int color){
          GradientDrawable gradientDrawable;
          gradientDrawable = (GradientDrawable) view.getBackground().mutate();
          gradientDrawable.setColor(getResources().getColor(color));
          gradientDrawable.invalidateSelf();
  
      }
  </code></pre>
  
  <p>How could I get GradientDrawable from LayerDrawable? </p>