title: How to change background image of a ImageButton in android
body: <p>I am facing a situation in which-
  1.First I have to set the background image of a ImageButton to a default image.
  2.Now at runtime based on some condition I have to change the background image of that ImageButton to some other image.</p>
  
  <p>I have tried this but it doesn't work and the background image remains to default image and 
  doesn't change.</p>
  
  <pre><code> btn.invalidateDrawable((Drawable)getResources().getDrawable(R.drawable.info));
                  btn.setBackgroundDrawable((Drawable)getResources().getDrawable(R.drawable.infonewred));
  </code></pre>
  
  <p>How can I achieve this goal.</p>