Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I do an Android Calendar import of recurring events with syncronizing?
    text
    copied!<p>For a students app I've implemented a Calendar import feature. An ICS-File will be downloaded from school website which has several events. All events are single events, not recurring events in the ics-file. The import works without problems. But when I want to delete all my imported events I sometimes get a message saying that the records cannot be synchronized. What I was thinking of now is:</p> <ul> <li>Parse ICS-File for all events</li> <li>Try to merge events as recurring events</li> <li>import the recurring events into calendar</li> </ul> <p>But whatever I do is not working. Either events are marked as recurring but monthly and not weekly as intended. Or keep being imported as single events.</p> <p>Here's the last code I've tried. </p> <pre><code> ContentValues event = new ContentValues(); event.put("calendar_id", calId); event.put("title", title); event.put("description", "[HSLU_TAAPP_IMPORTED]"); event.put("eventLocation", location); event.put("eventTimezone", "GMT+1"); long startTime = startDateTime.getTimeInMillis(); startDateTime.add(Calendar.HOUR, 1); long endTime = startDateTime.getTimeInMillis(); event.put("dtstart", startTime); event.put("rrule", "FREQ=WEEKLY"); event.put("dtend", endTime); Uri eventsUri = Uri.parse(getCalendarUriBase()+"events"); Uri insertedUri = _activity.getContentResolver().insert(eventsUri, event); return insertedUri; </code></pre> <p>Can anybody give me an example of how to do it right? Or is there another approach intended to get rid of the "cannot synchronize" message?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload