I\'ve been following a tutorial that explains how to use background for a button with different states but it doesn\'t seem to work :S
Here is my code :
<
Is the Button
the only thing you have displayed in your Activity
? If so, then it will be focused (triggering the third item in your selector
) when the window loads, and you won't be able to navigate away from it. If you want to change only when pressed, delete that third line. While you're at it, delete the first line, as the button will never be pressed when the window isn't focused.
In fact, I suggest this code: