I have some buttons that I want to have become invisible as soon as they are clicked and before they rest of the code that they start has been executed, but I have not been able to do this - instead my activity executes all of the code under that button and then makes the button invisible. How can I force the timing of the buttons' visibility? Here is the code I am using: