title: Progrommatically created Calendar not saved
body: <p>I'm trying to create calendar by using code from <a href="https://stackoverflow.com/questions/12033224/calendar-sync-with-custom-add-account-in-android">this topic</a></p>
  
  <pre><code> private static void  createCalendar( Context mContext, Account account)
  {
      final ContentValues v = new ContentValues();
      v.put(CalendarContract.Calendars.NAME,"TEST");
      v.put(CalendarContract.Calendars.CALENDAR_DISPLAY_NAME, "TEST");
      v.put(CalendarContract.Calendars.ACCOUNT_NAME, account.name);
      v.put(CalendarContract.Calendars.ACCOUNT_TYPE, account.type);
      v.put(CalendarContract.Calendars.CALENDAR_COLOR, Color.GREEN);
      v.put(CalendarContract.Calendars.CALENDAR_ACCESS_LEVEL, CalendarContract.Calendars.CAL_ACCESS_OWNER);
      v.put(CalendarContract.Calendars.OWNER_ACCOUNT, account.name);
     // v.put(CalendarContract.Calendars._ID, 123);
      v.put(CalendarContract.Calendars.SYNC_EVENTS, 1);
      v.put(CalendarContract.Calendars.VISIBLE, 1);
      Uri creationUri = asSyncAdapter(CalendarContract.Calendars.CONTENT_URI, account.name, account.type);
      Uri calendarData = mContext.getContentResolver().insert(creationUri, v);
      long id = Long.parseLong(calendarData.getLastPathSegment());
  }
  private static 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>and then make a call:</p>
  
  <pre><code>createCalendar(c,  AccountManager.get(c).getAccountsByType("com.google")[0]); // i've checked - it's correct account to add calendar
  </code></pre>
  
  <p>Then i retrive data from <code>ContentResolver</code></p>
  
  <pre><code>final ContentResolver cr = ctx.getContentResolver();
      Cursor cursor ;
      cursor = cr.query(Uri.parse("content://com.android.calendar/calendars"),null, null, null, null);
  </code></pre>
  
  <p>and see new calendar in cursor. But:</p>
  
  <ul>
  <li><p>it not appears in google accound</p></li>
  <li><p>it removes after some time (guess, because of synchronization)</p></li>
  </ul>
  
  <p>tested on 5.1.1</p>
  
  <p>How can I create calendar to my account progrommatically?</p>