title: checking button image in android
body: <p>In my android application i'm checking image of button.and then changing it.
  how can i do this?</p>
  
  <p>code-</p>
  
  <pre><code>Drawable a;
  a=b1.getBackground();
  int i=R.drawable.happy;
  // b1 is button
  if(a==R.drawable.happy)
   b1.setBackgroundResource(R.drawable.whoa);
  else
   b1.setBackgroundResource(R.drawable.happy);
  </code></pre>