title: ImageView setImageResource not working
body: <p>I have a custom class that inherits from <code>RelativeLayout</code>. I have an <code>ImageButton</code> called <code>control_btn</code> that's defined and added to the layout in an <code>init()</code> method. On the <code>onDraw</code>, I have the following code (among other things):</p>
  
  <pre><code>    control_btn.setImageResource(R.drawable.play_new);
      control_btn.getLayoutParams().width = getPixels(20);
      control_btn.getLayoutParams().height = getPixels(20);
      control_btn.setX(getPixels(0));
      control_btn.setY(getPixels(10));
      control_btn.setScaleType(ImageView.ScaleType.CENTER_INSIDE);
      control_btn.setAdjustViewBounds(true);
      control_btn.setPadding(0, 0, 0, 0);
      control_btn.setBackgroundColor(Color.TRANSPARENT);
      control_btn.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
              control_btn.setImageResource(R.drawable.pause);
              Log.d("WTH", "clicked");
          }
      });
  </code></pre>
  
  <p>However, the image never changes, despite getting the log entry.
  Further, I have another <code>ImageButton</code> with exactly the same code whose image DOES change (also inside the custom class).</p>
  
  <p>Any ideas on how to fix this?</p>