I'm adding an event, the event displays starting hour (hh:mm) and ending hour (hh:mm), there are 2 tiemPickers, one to pick starting time and one for duration.
Problem 1:
If the user picks the starting time to be at 10:30h and duration of 1:40h, the ending time should be 12:10h instead of 11:70h, how do I do this?
Problem 2:
If the user picks starting time of 23:00h and duration of 02:00h, ending time should be 01:00h instead of 25:00h.
What I have:
// getting the selected time
int endingHourInt = prefs.getInt("mDurationHour", 0) + prefs.getInt("mStartingHour",0);
int endingMinInt = prefs.getInt("mDurationMin", 0) + prefs.getInt("mStartingMin",0);
// displaying the text
endingTime.setText(endingHourInt + ":" + endingMinInt );