But why???
any onClickListener button will be called only if it is enabled. You do not need to worry about onClickListeners that are assigned to disabledButtons.
Suppose your button is disabled at startup, then this listener will not be applied to your button. Now after a while, if you turn on this button (maybe after some event, etc.), "THEN ALSO LISTEN TO THIS WORK", since you did not put the listener in the first place ...
therefore IMO does not insert this if ...
source share