title: Android: How to add events intoCalendar (SPlanner,GoogleCalendar) and synchronize these events with account
body: <p>at first I will apologize for my bad English, cause I am an not native speaker. 
  My issue is, I developed an application in android which crates calendar events and add this to the calendar like(S-planner, etc.) Finally this app should synchronize these events with the account. </p>
  
  <p><strong>NOW THE PROBLEM IS THIS:</strong>
  <em>Creating events is no problem, but in some devices the events are not shown in the calendar. As account, gmail is used.</em></p>
  
  <p><strong>CODE:</strong></p>
  
  <pre><code>ContentResolver cr = mainActivity.getContentResolver();
              ContentValues values = new ContentValues();
                  values.put(CalendarContract.Events.DTSTART, startMillis);
                  values.put(CalendarContract.Events.DTEND, endMillis);
                  values.put(CalendarContract.Events.TITLE, myMonthTmp.getKurzelList().get(k));
  
              //Checks if the rota contains specific days like *,K, -S-, etc...
              checkIfTrickContainSpecific(values,k);
  
                  values.put(CalendarContract.Events.CALENDAR_ID, calID);
                  values.put(CalendarContract.Events.EVENT_LOCATION, user.getWorkingArea());
                  values.put(CalendarContract.Events.EVENT_TIMEZONE, "Europe/Berlin");
              //Uri uri = cr.insert(CalendarContract.Events.CONTENT_URI, values);
  
              Uri uri = cr.insert(asSyncAdapter(CalendarContract.Events.CONTENT_URI, user.getAccount(),user.getAccountType(user.getAccount())),values);
  
  
  public Uri asSyncAdapter(Uri uri, String account, String accountType) {
      return uri.buildUpon()
              .appendQueryParameter(CalendarContract.CALLER_IS_SYNCADAPTER, "true")
              .appendQueryParameter(CalendarContract.Calendars.ACCOUNT_NAME, account)
              .appendQueryParameter(CalendarContract.Calendars.ACCOUNT_TYPE, accountType)
              .build();
  
  }
  </code></pre>
  
  <p>I will very thankful for each help...</p>