I am querying an event table in android to receive events.
String[] projection = new String[] { "calendar_id", "title", "description", "dtstart", "dtend", "eventLocation" }; Cursor cursor = cr.query(Uri.parse("content://com.android.calendar/events"), projection, null, null, null);
This returns all events. But now I want events to be held only for a certain duration: 03/03/2013 - 03/03/2013. How to use selection and selectionArgs[] ? I tried this
String selection = "((dtstart <= ?) AND (dtend >= ?))"; String[] selectionArgs = new String[] {startString, endString};
But he does not return anything. My doubts 1. Will there be work with the proposal? Since startDate and endDate are first converted to long (milliseconds), then to String, and then stored in the table. So, how can strings be compared for their long values. There is no toNumber() function in sqlite. 2. If I go through selectionArgs , then startString and endString should be in what format?
Chimu source share