I have an issue that I can't solve. I managed to insert my events into my android calendar but I want to make them recurring. For birthdays for example. I want them to repeat yearly. I have this code :
final ContentResolver cr = ctx.getContentResolver();
ContentValues cv = new ContentValues();
cv.put("calendar_id", calIds[0]);
cv.put("title", title);
cv.put("rrule", "FREQ=YEARLY");
cv.put("description", comment );
Calendar start = Calendar.getInstance();
start.set(2012, 0, 2, 8, 0, 0);
Calendar end = Calendar.getInstance();
end.set(2012, 0, 2, 9, 0, 0);
long startTime = start.getTimeInMillis();
long endTime = end.getTimeInMillis();
cv.put("dtstart", startTime);
cv.put("dtend", endTime);
//Insertion on the events of the calendar
cr.insert(Uri.parse("content://com.android.calendar/events"), cv);
It inserts my event but it doesn't do it recurring. I mean that my event appears on 2jan2012 but on 2jan2013 doesn't and neither does in 2014 and so on. So I opened my calendar on the phone and tried to edit my event and I saw that where I should select the occurence of it, there it shows "on 2 january 2012" not "on 2 january" as it should if it were to customize my event from my phone. On the other hand, if I try to add an event manually from my phone it works just fine( I mean I can add an event that occurs yearly). Another thing that I have noticed is that if I change the year, for example I put 2010 instead of 2012 it inserts my events yearly until my current date. To be more precise, it inserts an event on 2jan2010, another for 2jan2011 and for 2jan2012 it stops(today is 2nd january 2012) and after this date there are no more events inserted for this date. Has anyone experienced this type of problem? Any help is welcomed. Thank you!