Can't set dates of android calendar events when using ContentValues api -
i'm trying insert events in calendar created. i'm using following code so... it's taken google's documentation on calendarprovider.
the problem no matter values put in dtstart or dtend event created single day event , date current date.
i've tried use intent(intent.action_edit) .putextra dates... sadly doesn't well... neither dates set nor gives me modify them in edit intent.
any idea might causing behavior?
contentvalues event = new contentvalues(); event.put(events.calendar_id, e.getcalendarid()); event.put(events.title, e.gettitle()); event.put(events.description, e.getdescription()); event.put(events.event_timezone, timezone.getdefault().getdisplayname()); event.put(events.event_end_timezone, timezone.getdefault().getdisplayname()); event.put(events.guests_can_modify, 1); event.put(events.is_organizer, 1); event.put(events.dtstart, e.getdatestart()); event.put(events.dtend, e.getdateend()); event.put(events.all_day, 1); event.putnull(events.duration); event.putnull(events.rrule); event.putnull(events.rdate); uri eventuri = context.getcontentresolver().insert(events.content_uri, event); int eventid = integer.parseint(eventuri.getlastpathsegment());
Comments
Post a Comment