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.
More Related Contents:
- How to start new activity on button click
- How to make the corners of a button round?
- Custom circle button
- Android Material Design Button Styles
- Android button background is taking the primary color
- Change Screen Orientation programmatically using a Button
- Which is the best way to add a button?
- How to set a gradient background in a Material Button from Material Components?
- In Android, how do I set margins in dp programmatically?
- Android Preventing Double Click On A Button
- Android Fragment onClick button Method
- Android customized button; changing text color
- Android – border for button
- Coloring Buttons in Android with Material Design and AppCompat
- Why is my Button text forced to ALL CAPS on Lollipop?
- How can I remove a button or make it invisible in Android?
- How to add buttons at top of map fragment API v2 layout
- android – How can I make a button flash?
- Rounded Button in Android
- Button in custom Android Toast?
- Android Background Drawable Not Working in Button Since Android Studio 4.1
- Save image to sdcard from drawable resource on Android
- Get listview item position on button click
- How do I open a new fragment from another fragment?
- How to make a round button?
- How to add a button to a PreferenceScreen?
- Android – make an arrow shape with xml
- Rounded corners on material button
- How do I set a different color for the pressed state of the button?
- How to set a gradient background to a Material Button?