private void loadUserDOB() {
    DatePicker.OnDateChangedListener onDateChanged =
        new DatePicker.OnDateChangedListener() {
          @Override
          public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
            Log.v(
                Globals.TAG,
                "year : "
                    + year
                    + ", monthOfYear : "
                    + monthOfYear
                    + ", dayOfMonth : "
                    + dayOfMonth);
          }
        };

    if (null != user.getDateOfBirth()) {
      String dob[] = user.getDateOfBirth().split("-");
      year = Integer.parseInt(dob[0]);
      month = Integer.parseInt(dob[1]);
      day = Integer.parseInt(dob[2]);

    } else {
      Calendar c = Calendar.getInstance();
      year = c.get(Calendar.YEAR);
      month = c.get(Calendar.MONTH);
      day = c.get(Calendar.DAY_OF_MONTH);
    }

    pickerDOB.init(year, month, day, onDateChanged);
    pickerDOB.setCalendarViewShown(false);
    pickerDOB.setSpinnersShown(true);
  }
Пример #2
0
 private void setupScreen() {
   mPickerDate.setCalendarViewShown(mCalendarViewShown);
   mPickerDate.setSpinnersShown(mSpinnerShown);
 }