Code example for DatePicker

Methods: updateDate

0
 
	public void setTime(long time) {
		if (picker != null) {
			Calendar cal = Calendar.getInstance();
			cal.setTimeInMillis(time);
			picker.updateDate(cal.get(Calendar.YEAR), cal.get(Calendar.MONDAY),
					cal.get(Calendar.DAY_OF_MONTH));
			setSummaryTime(cal.getTimeInMillis());
		} 
	} 
 
	@Override 
	protected Parcelable onSaveInstanceState() {
		final Parcelable superState = super.onSaveInstanceState();
		if (picker == null) {
			return superState;
		} 
 
		final SavedState myState = new SavedState(superState);
		myState.time = getTime();
		return myState;