I'm using a DialogFragment to open a DatePickerDialog
public class DatePickerFragment extends DialogFragment{
@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);
// Create a new instance of DatePickerDialog and return it
DatePickerDialog DatePickerDialog = new DatePickerDialog(getActivity(), (ProfileCreationActivity)getActivity(), year, month, day);
return DatePickerDialog;
}
I'm getting a calendar look, where I would prefer a spinner look.
I tried:
datePickerDialog.getDatePicker().setCalendarViewShown(false);
and
datePickerDialog.getDatePicker().setLayoutMode(1);
but it does not work.
Please note that I want the spinner look for one activity, but that I will want the calendar view for another activity. So I can not change the whole application style. I need a custom style for one activity.