0

I have gone through some of the links and i got to know how to insert an event to the calendar App of Android (rather than creating my own calendar). Now, I need to create a event which repeats every Tuesday and Thursday but I don't have the option of selecting such a choice. So how can I do that programmatically?

Any help would be greatly appreciated.

Dev
  • 122
  • 2
  • 11

1 Answers1

2

Using Android 4.0:

New Event: Hanging out at Stack Overflow Tuesdays and Thursdays in April 2012 between 8:30-9:30am.

Intent intent = new Intent(Intent.ACTION_INSERT)
    .setData(Events.CONTENT_URI)
    .putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME, 1333456200000L)
    .putExtra(CalendarContract.EXTRA_EVENT_END_TIME, 1333459800000L)
    .putExtra(Events.TITLE, "Hanging out at Stack Overflow")
    .putExtra(Events.RRULE, "FREQ=DAILY;BYDAY=TU,TH;UNTIL=20120430T083000Z")
    .putExtra(Events.RDATE, 1335792600000L)
    .putExtra(Events.AVAILABILITY, Events.AVAILABILITY_BUSY);
startActivity(intent);

Sources:
http://developer.android.com/guide/topics/providers/calendar-provider.html
https://www.rfc-editor.org/rfc/rfc5545

Community
  • 1
  • 1
Draghon
  • 347
  • 3
  • 9
  • have a look at this issue: http://stackoverflow.com/questions/28871921/add-weekly-event-to-calendar – Sun Jul 01 '15 at 11:42