Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android disabling a button

Tags:

android

I can't figure out why this wouldn't set a button to be disabled?

btnSaturdayStartTime = (Button)findViewById(R.id.btnSaturdayStartTime);
btnSaturdayStartTime.setEnabled(false);     

When I click on the button it still fires the listener.

like image 757
user660734 Avatar asked Jul 17 '26 03:07

user660734


1 Answers

Try using btnSaturdayStartTime.setClickable(false).

See setClickable from the docs.

like image 117
Marc Bernstein Avatar answered Jul 20 '26 11:07

Marc Bernstein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!