I've a Switch with a listener:
mSwitch.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
}
Doing:
mSwitch.setChecked(false);
has no effect, callback is not triggered. Instead like this:
mSwitch.setChecked(true);
mSwitch.setChecked(false);
works as expected. Am I doing something wrong? If the checkbox state is false and one use setChecked(false), the normal behaviour is to skip callback? Or is it a bug?
It will be Called when the checked state of a compound button has changed.
So if its state is already false it won't be called when you call false.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With