I am new to Android programming and I am using a basic Datepicker created using DialogFragment. My DatePicker displays fine when pressed, etc., but the problem is that it also displays the Calendar view. I do not want this. I have been looking for a solution for the day, and now I do not want to use custom Datepickers, since I want to get familiar with the basics first.
I also read sentences like
yourDatepicker.setCalendarViewShown(false);
or set it to false in XML. But my DatePicker comes from the DialogFragment dialog, so how do I access this dumper? How to set the final look? I do not want to make changes to the source code, as I am still studying the ropes.
My datpike code:
public class DueDatePickerFragment extends DialogFragment implements DatePickerDialog.OnDateSetListener { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { 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); return new DatePickerDialog(getActivity(), this, year, month, day); } public void onDateSet(DatePicker view, int year, int month, int day){
source share