Sets the year, month, and day of the month fields. Other fields are not changed; call clear() first if this is not desired. The month value is 0-based, so it may be clearer to use a constant like JANUARY.
0-January, 1-February, 2-March, 3-April, 4-May, 5-June, 6-July, 7-August, 8-September, 9-October, 10-November, 11-December
2. In theonDateSet method, add the line below to set the Calendar object date. If the user selects the date in the DatePickerDialog of December 25, 2014, the Calendar object would be set to that date.
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
// this method will get the year, month and day the user chose on the datepickerdialog
myCalendar.set(year, monthOfYear, dayOfMonth)
// To test, add a Toast with a
//context of getBaseContext()
//and a message of: "Month: " + myCalendar.get(MONTH) + "Day: " + myCalendar.get(Calendar.DAY_OF_MONTH) + "Year: " + myCalendar.get(Calendar.YEAR)
}
//context of getBaseContext()
//and a message of: "Month: " + myCalendar.get(MONTH) + "Day: " + myCalendar.get(Calendar.DAY_OF_MONTH) + "Year: " + myCalendar.get(Calendar.YEAR)
}