判断是否点击!buttonView.isPressed()来解决
CompoundButton.OnCheckedChangeListener checkedChangeListener = new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (switchCheckedListener == null) {
return;
}
if (!buttonView.isPressed()) {
return;
}
switchCheckedListener.checked(isChecked);
}
};