How to change the states of buttons from the code. I cannot use xml files since I am getting the images from the server.
Using :
Drawable d = new BitmapDrawable(getResources(),bitmap);
I have got the drawable but how do I assign different states and then attach corresponding images for the button?