I am trying to limit the max value of the seekbar to a certain value in this case 11 on a range from 1 to 50. But the when i try to do this the code enters into infinite loop.
Is there any way to limit the value of range ?
crystalRangeSeekbar.setOnRangeSeekbarChangeListener(new OnRangeSeekbarChangeListener() {
@Override
public void valueChanged(Number minValue, Number maxValue) {
if (maxValue.intValue() > 11) {
crystalRangeSeekbar.setMaxStartValue(11).setMinStartValue(1).apply();
crystalRangeSeekbar.apply();
return;
}
MainActivity.this.minValue = minValue.intValue();
MainActivity.this.maxValue = maxValue.intValue();
}
});
I am trying to limit the max value of the seekbar to a certain value in this case 11 on a range from 1 to 50. But the when i try to do this the code enters into infinite loop. Is there any way to limit the value of range ?