Subclass of CompoundButton, like Switch, Checkbox etc...

Setting ‘isChecked’ is triggered toggle animation.

So, it may acting weird not just you want to.
Key point is “animation.”

At this time, “jumpDrawablesToCurrentState()” function might be help.
it set button state without animation.

isChecked = value
jumpDrawablesToCurrentState()