I created an image button that will change to another image when pressed. But, when I pressed the back button or switch to landscape
orientation, the image button will go back to its default image.
I reckon that i need to save the image's state when it is pressed?
Anyone can help?
ib1.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
if(isPressed)
ib1.setBackgroundResource(R.drawable.star_pressed);
else
ib1.setBackgroundResource(R.drawable.star_unpressed);
isPressed = true;
}
});