Java.lang.IllegalArgumentException: Event values ​​must include an eventTimezone

I m developing a app which need to add events to the native calendar in android. I followed : http://www.grokkingandroid.com/androids-calendarcontract-provider/#comment-341407 http://developer.android.com/guide/topics/providers/calendar-provider.html

this is the code of addEvent() method I tried(which is exactly same in first tutorial)

public void addEvents()
    {
        long calId = getCalendarId();
        if (calId == -1) {
            // no calendar account; react meaningfully
            return;
        }
        Log.i(LOGTAG,calId+"");
        Calendar cal = new GregorianCalendar(2012, 11, 14);
        cal.setTimeZone(TimeZone.getTimeZone("UTC"));
            cal.set(Calendar.HOUR, 0);
            cal.set(Calendar.MINUTE, 0);
            cal.set(Calendar.SECOND, 0);
            cal.set(Calendar.MILLISECOND, 0);

        long start = cal.getTimeInMillis();
        ContentValues values = new ContentValues();
                    values.put(Events.DTSTART, start);
                    values.put(Events.DTEND, start);
                    values.put(Events.RRULE,
                          "FREQ=DAILY;COUNT=20;BYDAY=MO,TU,WE,TH,FR;WKST=MO");
                    Log.i(LOGTAG,calId+" before titile");
                    values.put(Events.TITLE, "Some title");
                    values.put(Events.EVENT_LOCATION, "Munster");

                    Log.i(LOGTAG,calId+" cal ID");
                    values.put(Events.CALENDAR_ID, calId);

                Log.i(LOGTAG,calId+" timezone");

                    **values.put(Events.EVENT_TIMEZONE, "Europe/Berlin");**
                    values.put(Events.DESCRIPTION,
                          "The agenda or some description of the event");
 //....
}

This code gives "java.lang.IllegalArgumentException: Event values must include an eventTimezone"

I tried many solutions found in google but nothing could solve this problem..


Try this:

values.put(CalendarContract.Events.EVENT_TIMEZONE, TimeZone.getDefault().getID());