Is there a way to use the Android NumberPicker widget for choosing strings instead of integers?
NumberPicker numberPicker = new NumberPicker(this);
String[] arrayString= new String[]{"hakuna","matata","timon","and","pumba"};
numberPicker.setMinValue(0);
numberPicker.setMaxValue(arrayString.length-1);
numberPicker.setFormatter(new NumberPicker.Formatter() {
@Override
public String format(int value) {
// TODO Auto-generated method stub
return arrayString[value];
}
});
hope that helps!