0

Possible Duplicate:
How to add calendar events in Android?

I am working with the android calendar...i have created an event in android calendar but i want to add an event on and specific date like i want to add an event on 2012-11-13 then how to add an event on this date....

ContentValues event = new ContentValues();
        Uri eventsUri = Uri.parse("content://com.android.calendar/events");



    event.put("calendar_id", 1);
    event.put("title", "Today's Event [TEST]");  
    event.put("description", "2 Hour Presentation");
    event.put("eventLocation", "Online");  



    long startTime = System.currentTimeMillis() + 1000 * 60 * 60;
    long endTime = System.currentTimeMillis() + 1000 * 60 * 60 * 2;

    event.put("dtstart", startTime);
   event.put("dtend", endTime);  

    event.put("allDay", 0); // 0 for false, 1 for true
    event.put("eventStatus", 1);
    event.put("visibility", 0);
    event.put("transparency", 0);
    event.put("hasAlarm", 0); // 0 for false, 1 for true


    Uri insertedUri = getContentResolver().insert(eventsUri, event);

I have this code which is saved event on the current date but i want to add event on future date like 2012-11-30!!!!

Community
  • 1
  • 1
miten joshi
  • 185
  • 1
  • 8
  • Here you go, [Everything about Calendar Content Provider](http://www.grokkingandroid.com/androids-calendarcontract-provider/) – Paresh Mayani Oct 30 '12 at 04:53
  • 1
    Check this tutorial: http://www.developer.com/ws/android/programming/Working-with-the-Android-Calendar-3850276.htm – Lokesh Oct 30 '12 at 04:54

0 Answers0