title: Add events to Calendar programmatically
body: <p>I'm using below code in Marshmellow device to add the event to the Calendar programmatically but it's not working. Any idea? I cannot see this event in the Calendar app.</p>
  
  <pre><code>        long startMillis = 0;
          long endMillis = 0;
          SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          Date startDate = null, endDate = null;
          try{
              startDate = simpleDateFormat.parse("2017-05-01 01:30:00");
              startMillis = startDate.getTime();
              endDate = simpleDateFormat.parse("2017-05-01 03:30:00");
              endMillis = endDate.getTime();
          }catch (ParseException e){
              e.printStackTrace();
          }
  
          ContentResolver cr = this.getContentResolver();
          ContentValues values = new ContentValues();
          TimeZone timeZone = TimeZone.getDefault();
          values.put(CalendarContract.Events.DTSTART, startMillis);
          values.put(CalendarContract.Events.DTEND, endMillis);
          values.put(CalendarContract.Events.EVENT_TIMEZONE, timeZone.getID());
          values.put(CalendarContract.Events.TITLE, "Hello Title");
          values.put(CalendarContract.Events.DESCRIPTION, "Add events to Calendar");
          values.put(CalendarContract.Events.CALENDAR_ID, 879);
          Uri uri = cr.insert(CalendarContract.Events.CONTENT_URI, values);
  </code></pre>
  
  <p><strong>PS: It works if only one gmail account is synced with the calendar app.</strong></p>