Code example for DatePicker

Methods: getDayOfMonthgetMonthgetYearupdateDate

0
			if (null == foodDate) 
			{ 
				foodDate = Calendar.getInstance();
			} 
 
			foodDate.set(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth(), 0, 0, 0); 
			// update xml file 
			FoodInfo foodInfo = new FoodInfo(foodName, foodDate);
			xmlUtil.updateEntry(foodInfo);
			// set new alarm 
			FoodReceiver alarm = new FoodReceiver(EditEntry.this, foodDate, true);
			// popup toast confirming the submit 
			showMsg("Reminder added."); 
			// clear foodName & foodDate to avoid problems if user want to sumbit several items in a row 
			foodName = null; 
			foodDate = null; 
			// clear widgets 
			foodNameTextView.setText(""); 
			datePicker.updateDate(currentDate.get(Calendar.YEAR), currentDate.get(Calendar.MONTH), currentDate.get(Calendar.DAY_OF_MONTH));
		} 
		 
		private void showMsg(String msg)
		{ 
			Toast.makeText(EditEntry.this, msg, Toast.LENGTH_SHORT).show();