I am fairly new to android programming (but not to Java programming). I have a use case where a user clicks a ‘Go >>’ Button. Once the button is clicked, the text on the button changes to ‘Done!’ and the user can click the same button once he is ‘done’.
I am wondering what is the best approach to implement this button behaviour… One approach that I can think of is to check for the button text and trigger appropriate action – is there a better way that you could recommend? Thanks!
The “best” approach is probably to check a boolean flag in the OnClickListener if the Button has already been clicked.
An alternative approach is to check the value of the Buttons’ text, but this is a few milliseconds slower.