I can't figure out why this wouldn't set a button to be disabled?
btn开发者_如何学编程SaturdayStartTime = (Button)findViewById(R.id.btnSaturdayStartTime);
btnSaturdayStartTime.setEnabled(false);     
When I click on the button it still fires the listener.
Try using btnSaturdayStartTime.setClickable(false).
See setClickable from the docs.
try the method : Button.setClickable(false) ; 
or delete the listener on your button  like this : button.setOnClickListener(null);
Maybe the button is recreated or re-enabled between you disabling it an the user click interaction. Are you sure you are disabling the right button? What version of Android are you targeting?
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论