From: Marius Gavrilescu Date: Sun, 9 Jun 2013 21:41:11 +0000 (+0300) Subject: Default eventColour to the calendar colour X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=810f5287ab8b7f0065303bde41706890e550c3cd;p=unical.git Default eventColour to the calendar colour --- diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java index 23ccd74..97ce822 100644 --- a/src/ro/ieval/unical/Event.java +++ b/src/ro/ieval/unical/Event.java @@ -67,17 +67,19 @@ final class Event implements Parcelable{ this.calendarID=calendarID; } - public static Event[] getEventsByCalendar(final Context context, final long calendarID, final String sort){ + public static Event[] getEventsByCalendar(final Context context, final Calendar calendar, final String sort){ final ContentResolver cr=context.getContentResolver(); final Cursor cursor = cr.query(Events.CONTENT_URI, PROJECTION, Events.CALENDAR_ID+" = ?", - new String[]{Long.toString(calendarID)}, + new String[]{Long.toString(calendar._id)}, sort); cursor.moveToFirst(); final Event[] events = new Event[cursor.getCount()]; for(int i=0;i r = new ArrayList(); for(final Calendar calendar : Calendar.getAllCalendars(context)) - for(final Event event : getEventsByCalendar(context, calendar._id, null)) + for(final Event event : getEventsByCalendar(context, calendar, null)) r.add(event); return r.toArray(new Event[r.size()]); }