I've been trying to access and modify the events data for contacts, with no success. Getting any other data is easy, modifying it is fairly easy, but for the events table seems impossible, it just can't seem to find the data. Here's the code, is there some mistake with it?
String genericWhere=ContactsContract.Data.CONTACT_ID + " = ? AND " + ContactsContract.Data.MIMETYPE + " = ?";
String[] eventWhereParams = new String[]{id, ContactsContract.CommonDataKinds.Event.CONTENT_ITEM_TYPE};
Cursor eventCur = cr.query(ContactsContract.Data.CONTENT_URI, null, genericWhere, eventWhereParams, null);
while(eventCur.moveToNext()){
String col=ContactsContract.CommonDataKinds.Event.START_DATE;
String startDate=eventCur.getString(eventCur.getColumnIndex(col));
col=ContactsContract.CommonDataKinds.Event.TYPE;
int eventType=eventCur.getInt(eventCur.getColumnIndex(col));
messages.add(eventType +" : "+ startDate);
}
eventCur.close();
Thanks.