Goal
I'm trying to add event to Android calendar which will sync these events automatically to Google Calendar.
Problem
Events appear on my local Google Calendar on my Android, but the events don't get synced to Google. If I add an event manually in the preinstalled calendar app the event gets synced to Google.
This is my add event code:
Any suggestions to get this sync workig?
I'm trying to add event to Android calendar which will sync these events automatically to Google Calendar.
Problem
Events appear on my local Google Calendar on my Android, but the events don't get synced to Google. If I add an event manually in the preinstalled calendar app the event gets synced to Google.
This is my add event code:
Code:
private void createEvent(long calendarId, SomeEvent event){
ContentValues values = new ContentValues();
values.put(Events.DTSTART, event.getStart());
values.put(Events.DTEND, event.getStart() + event.getDuration());
values.put(Events.TITLE, event.getName());
values.put(Events.EVENT_LOCATION, "US");
values.put(Events.CALENDAR_ID, calendarId);
values.put(Events.EVENT_TIMEZONE, "New York");
values.put(Events.ACCESS_LEVEL, Events.ACCESS_PRIVATE);
values.put(Events.SELF_ATTENDEE_STATUS,Events.STATUS_CONFIRMED);
Uri uri = contentResolver.insert(CalendarContract.Events.CONTENT_URI, values);
}
Any suggestions to get this sync workig?