Ответ 1
static Boolean isTouched = false;
switchButton.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
isTouched = true;
return false;
}
});
switchButton.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener()
{
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
if (isTouched) {
isTouched = false;
if (isChecked) {
}
else {
}
}
}
});
Попробуй это!