@Override
        public void onClick(final View arg0) {
            final MaterialDatePicker<Long> dateDialog = MaterialDatePicker.Builder
                    .datePicker()
                    .setSelection(date.getTimeInMillis() + TimeZone.getDefault().getRawOffset())
                    .build();
            dateDialog.addOnPositiveButtonClickListener(timestamp -> {
                if (resetButton != null) {
                    dateUnset[0] = false;
                }

                final Calendar newDate = Calendar.getInstance();
                newDate.setTimeInMillis(timestamp - TimeZone.getDefault().getRawOffset());

                // only update the date, but keep the previous time
                date.set(newDate.get(Calendar.YEAR), newDate.get(Calendar.MONTH), newDate.get(Calendar.DAY_OF_MONTH));
                Settings.setLastUsedDate(newDate);
                triggerChange();
            });
            dateDialog.show(fragmentManager, "date_dialog");
        }
If currently there is no date/time set, then this method sets the preselected date for later calls.
If a date is selected, this method does nothing
main/src/main/java/cgeo/geocaching/ui/DateTimeEditor.java