How to disable an Android button?

Did you try this?

myButton.setEnabled(false); 

Update: Thanks to Gwen. Almost forgot that android:clickable can be set in your XML layout to determine whether a button can be clickable or not.

Leave a Comment