I am making a number picker dialog having 2 number pickers, years and months. I want to show some default value in these 2 number picker, apart from 0, 0
Code::
final NumberPicker numberPickerYear = (NumberPicker) expDialog.findViewById(R.id.numberPickerYears);
final NumberPicker numberPickerMonth = (NumberPicker) expDialog.findViewById(R.id.numberPickerMonths);
numberPickerYear.setMaxValue(35);
numberPickerYear.setMinValue(0);
numberPickerYear.setWrapSelectorWheel(true);
numberPickerMonth.setMaxValue(11);
numberPickerMonth.setMinValue(0);
numberPickerMonth.setWrapSelectorWheel(true);
By default maxValue and minValue in NumberPicker is 0. So you need to set maxValue and minValue before using setValue.
numberPickerMonth.setValue(defaultQuanity);