From: Petru Trimbitas Date: Sun, 9 Jun 2013 08:18:37 +0000 (+0300) Subject: Add function to return all events from calendar X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=92086ce732a4e98eac56d86dbc5bf64ac63d50c9;p=unical.git Add function to return all events from calendar --- diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java index af41133..8482e31 100644 --- a/src/ro/ieval/unical/Event.java +++ b/src/ro/ieval/unical/Event.java @@ -1,5 +1,7 @@ package ro.ieval.unical; +import java.util.ArrayList; + import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; @@ -79,6 +81,17 @@ final class Event implements Parcelable{ } return events; } + + public static Event[] getAllEvents(final Context context) { + Calendar[] calendars = Calendar.getAllCalendars(context); + ArrayList r = new ArrayList(); + for(int i=0; i