I am currently working on an app that features a range seek bar. My objective is to invoke a method passing the minimum value of the bar if it has been changed, and likewise to trigger another method passing the maximum value if it has been changed. Below is the code snippet in progress:
rangeSeekbar.setOnRangeSeekBarChangeListener(new RangeSeekBar.OnRangeSeekBarChangeListener<Integer>() {
@Override
public void onRangeSeekBarValuesChanged(RangeSeekBar<?> bar, Integer minValue, Integer maxValue) {
//invoke when min value changes
mywebView.loadUrl("javascript:setStart(" + minValue.intValue() + ")");
//invoke when max value changes
mywebView.loadUrl("javascript:setEnd(" + maxValue.intValue() + ")");
}
Toast.makeText(getApplicationContext(), minValue + "-" + maxValue, Toast.LENGTH_LONG).show();
}
});
An issue arises where both methods are called even if only one value changes. I am seeking guidance on how to distinguish between the method calls. Any suggestions would be greatly appreciated.