I've made a numberpicker dialog. It looks like the image on the left, but without the up/down arrows:
How can I add them?
Here's my code:
public class NumberPickerFragment extends DialogFragment
implements DialogInterface.OnClickListener {
protected final String CLS = this.getClass().getSimpleName();
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// TODO: Make this more flexible
NumberPicker np = new NumberPicker(getActivity());
np.setMaxValue(250);
np.setMinValue(100);
np.setValue(150);
np.setDescendantFocusability(NumberPicker.FOCUS_BLOCK_DESCENDANTS);
np.setWrapSelectorWheel(false);
return new AlertDialog.Builder(getActivity())
.setTitle(R.string.height)
.setView(np)
.setPositiveButton(android.R.string.ok, this)
.create();
}
@Override
public void onClick(DialogInterface dialog, int whichButton) {
// TODO: Do something with the return value
Log.d(CLS, "Received click");
}
}