How can i change the increment of the NumberPicker
from 1 to a number you want like 1000?
numberPicker.setMinValue(1000);
numberPicker.setMaxValue(15000);
This is how I set my NumberPicker and I dont want to increment it by 1 because it would take you longer time to reach like 8000 since the steps are by 1.
I have tried this one, numberPicker.setDisplayedValues(somethig_array)
but with this i still have to provide all values with display values. Still not for me.
And lastly I tried using the OnValueChangeListener
from this answer :
numberPicker.setOnValueChangeListener(new NumberPicker.OnValueChangeListener() {
@Override
public void onChange(NumberPicker picker, int oldVal, int newVal) {
picker.setValue((newVal < oldVal)?oldVal-1000:oldVal+1000);
}
});
Even though the next number of 1000 is 2000, but still it will display the 10001-1999.
Is there any way to modify the increments of the NumberPicker
?
Any idea is greatly appreciated.