title: How to Add recurring events programmatically?
body: <p>I am developing an application for adding events to calendar. I am using following code to insert recurring event but it force closes the application with an error:</p>
  
  <blockquote>
    <p>"java.lang.IllegalArgumentException: DTEND and DURATION cannot both be null for an event."</p>
  </blockquote>
  
  <p>code:</p>
  
  <pre><code>ContentValues event = new ContentValues();
  event.put("calendar_id", 1);
  event.put("title", "Event Title");
  event.put("description", "Event Desc");
  event.put("eventLocation", "Event Location");
  event.put("dtstart", Long.parseLong("1315432844000"));
  event.put("rrule", "FREQ=WEEKLY;WKST=SU;BYDAY=WE");
  event.put("allDay", 1);   // 0 for false, 1 for true
  event.put("eventStatus", 1);
  event.put("hasAlarm", 1); // 0 for false, 1 for true
  Uri url = getContentResolver().insert(eventsUri, event);
  </code></pre>