In my android application i’m checking image of button.and then changing it.
how can i do this?
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);
Try this: