From: Marius Gavrilescu Date: Wed, 29 May 2013 21:35:24 +0000 (+0300) Subject: Add sort order to Event#getEventsByCalendar X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=fc891ea8c0845745b2cbde20d0f4a80511fa2228;p=unical.git Add sort order to Event#getEventsByCalendar --- diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java index 85ad215..2842638 100644 --- a/src/ro/ieval/unical/Event.java +++ b/src/ro/ieval/unical/Event.java @@ -64,13 +64,13 @@ final class Event implements Parcelable{ this.calendarID=calendarID; } - public static Event[] getEventsByCalendar(final Context context, final int calendarID){ + public static Event[] getEventsByCalendar(final Context context, final int calendarID, final String sort){ final ContentResolver cr=context.getContentResolver(); final Cursor cursor = cr.query(Events.CONTENT_URI, PROJECTION, Events.CALENDAR_ID+" = ?", new String[]{Integer.toString(calendarID)}, - null); + sort); cursor.moveToFirst(); final Event[] events = new Event[cursor.getCount()]; for(int i=0;i