Code example for Time

Methods: before, setToNow

0
 
	// updates the date in the TextView 
	private void updateDisplay() { 
		final StringBuilder sb = new StringBuilder();
 
		final Time now = new Time();
		now.setToNow();
 
		final Time bday = new Time();
		bday.monthDay = mDay;
		bday.month = mMonth;
		bday.year = mYear;
		bday.normalize(true);
 
		if (now.before(bday)) {
			sb.append("Du bist noch nicht geboren!");
		} else if (now.month == mMonth && now.monthDay == mDay) {
			now.year -= mYear;
 
			sb.append("Alles gute zum ").append(now.year)
					.append(". Geburstag!");