}
public static Event[] getAllEvents(final Context context) {
- Calendar[] calendars = Calendar.getAllCalendars(context);
- ArrayList<Event> r = new ArrayList<Event>();
- for(int i=0; i<calendars.length; ++i) {
- Event[] e=getEventsByCalendar(context, calendars[i]._id, "");
- for(int j=0; j<e.length; ++j)
- r.add(e[j]);
- }
+ final ArrayList<Event> r = new ArrayList<Event>();
+ for(final Calendar calendar : Calendar.getAllCalendars(context))
+ for(final Event event : getEventsByCalendar(context, calendar._id, null))
+ r.add(event);
return r.toArray(new Event[r.size()]);
}