In my app I create an object that represents a high school class. This object holds 2 Calendar objects that represents the class\'s start and stop time each day. When a user c
You can use Calendar.get()
, as mentioned in another answer. To compare minutes, though, you should use Calendar.MINUTE, too:
int minutes_in_day = time.get(Calendar.HOUR_OF_DAY)*60 + time.get(Calendar.MINUTE);
Then, you can just compare the minutes within the day of the current time with that of the start and end times. This will, of course, only work when the times are in the same day.