I read the documentation: http://developer.android.com/guide/topics/ui/controls/pickers.html but now in lollipop appears the calendar (it is ok for an event but horrible for set a date of birth, I would a spinner mode.) and I can't remove it! In layout It's easy with this property:
<DatePicker
datePickerMode="spinner"...>
but from code of the DatePickerDialog if I try to set
dialogDatePicker.getDatePicker().setSpinnersShown(true);
dialogDatePicker.getDatePicker().setCalendarViewShown(false);
These properties do not work and the calendar continues to appear!
public static class MyDatePicker extends DialogFragment implements DatePickerDialog.OnDateSetListener {
int pYear;
int pDay;
int pMonth;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
// Use the current date as the default date in the picker
final Calendar c = Calendar.getInstance();
int year = c.get(Calendar.YEAR);
int month = c.get(Calendar.MONTH);
int day = c.get(Calendar.DAY_OF_MONTH);
DatePickerDialog dialogDatePicker = new DatePickerDialog(getActivity(), this, year, month, day);
dialogDatePicker.getDatePicker().setSpinnersShown(true);
dialogDatePicker.getDatePicker().setCalendarViewShown(false);
return dialogDatePicker;
// Create a new instance of DatePickerDialog and return it
//return new DatePickerDialog(getActivity(), this, year, month, day);
}
public void onDateSet(DatePicker view, int year, int month, int day) {
pYear = year;
pDay = day;
pMonth = month;
}
}



