Code example for Time

Methods: format2445, setToNow

0
	private String formatForButton(Time time) {
		return time.format("%H:%M");
	} 
 
	private Time getTime(Intent intent, String buttonKey) {
		Time time = new Time();
		String timeStr = intent.getStringExtra(buttonKey);
		if (timeStr != null) {
			time.parse(timeStr);
		} else { 
			time.setToNow();
			intent.putExtra(buttonKey, time.format2445());
		} 
		return time;
	} 
 
	@Override 
	public void onFinishDialog(String buttonId, int hour, int minute) {
		int id = R.id.edit_schedule_start;
		if (buttonId.equals(END)) {
			id = R.id.edit_schedule_end;