1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
ContentValues event = new ContentValues();
// Calendar in which you want to add Evnet
event.put("calendar_id", CalIds[0]);
// Title of the Event
event.put("title", "Birthday");
// Description of the Event
event.put("description", "Birthday Party");
// Venue of the Event
event.put("eventLocation", "Delhi");
// Start Date of the Event
event.put("dtstart", StartDate);
// End Date of the Event
event.put("dtend", EndDate);
// Event is all day
event.put("allDay", 1);
// Set alarm on this Event
event.put("hasAlarm",1);
Uri eventsUri = Uri.parse("content://com.android.calendar/events");
// event is added
getContentResolver().insert(eventsUri, event);
cursor.close(); |
Partager