I encounter the problem with Switch in android. Here's my code to handle OnCheckedChangeListener of Switch:
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean isChecked) {
if (compoundButton.isPressed()) {
myCodeHere();
}
}
The condition if (compoundButton.isPressed()) to avoid onCheckedChanged called automatically. But when I slider Switch then myCodeHere() don't trigger.
Please give me some hint to resolve this issue. Or any way to disable slider of Switch ? Thanks a lot