In my app, I've list of events scheduled in next 5 days which are in ascedning order based on Start time. Now I want to display next upcoming task in my app. So my problem is if event's start time is matching current system time, then i want to remove that event from event list and next event should be on displayed in my activity as next upcoming event.
E.g :
Event1 2pm to 4pm.
Event2 5pm to 6pm.
Event3 8pm to 9pm.
ArrayList<Event> allEvents;
// Populate all Event data with event title and start time.
Event = allEvents.get(0);
Long top_event_start_time = Event.get_start_time();
Activity shows Event1 "Event1 scheduled at 2 pm". At 2 pm I want activity to display Event2.
Please suggest which method would be appropriate.