title: how to display android:imageView with GradientDrawable and setImageResource dynamically ?
body: <p>I want to make ImageView with specific GradientDrawable and make the <code>src = "@drawable/myImage"</code>. When I try this code I get all things fine but the <code>src</code> image doesn't display:</p>
  
  <pre><code>leftIcon = (ImageView)rowView.findViewById(R.id.left_icon);
  leftIcon.setImageResource(R.drawable.arrow333);
  
  GradientDrawable gd=new GradientDrawable();
  gd.setCornerRadii(getRandomFloatArray());
  gd.setStroke(5, Color.WHITE);
  gd.setColor(values[position].getColor());
  
  GradientDrawable gd_press=new GradientDrawable();
  gd_press.setCornerRadii(getRandomFloatArray());
  gd_press.setStroke(5, Color.BLUE);
  gd_press.setColor(values[position].getColor());
  
  StateListDrawable states = new StateListDrawable();
  states.addState(new int[] {android.R.attr.state_pressed}, gd_press );
  states.addState(new int[] {android.R.attr.state_focused}, gd_press);
  states.addState(new int[] { }, gd);
  
  leftIcon.setImageResource(R.drawable.arrow333);
  leftIcon.setImageDrawable(states);
  </code></pre>
  
  <p>And my xml file:</p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/left_icon"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:clickable="true" /&gt;
  </code></pre>