title: Android: CalendarProvider events not created and sometimes disappears after created(in few devices)
body: <p>I am creating calendar event programmatically(Android platform).</p>
  
  <p>Following is my piece of code:
  Here User has right to select plan <em>date(<code>planDate.value</code>)</em>, <em>start time(<code>planStartTime.value</code>)</em>, <em>end time(<code>planEndTime.value</code>)</em> and enter plan <em>name(<code>planName.value</code>)</em></p>
  
  <pre><code>private fun createCalendarEvent(context: Context) {
          val startDateObj = SimpleDateFormat(simpleDateFormateMM, Locale.US).parse("${planDate.value} ${planStartTime.value}") // Here I am fetching data selected by user
          val endDateObj = SimpleDateFormat(simpleDateFormateMM, Locale.US).parse("${planDate.value} ${planEndTime.value}")
  
          val calendar = Calendar.getInstance()
          calendar.time = startDateObj
  
          val startMillis: Long = Calendar.getInstance().run {
              // month starts from 0
              set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE))
              timeInMillis
          }
          calendar.time = endDateObj
          val endMillis: Long = Calendar.getInstance().run {
              set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), calendar.get(Calendar.DAY_OF_MONTH), calendar.get(Calendar.HOUR_OF_DAY), calendar.get(Calendar.MINUTE))
              timeInMillis
          }
  
          val values = ContentValues().apply {
              put(CalendarContract.Events.DTSTART, startMillis)
              put(CalendarContract.Events.DTEND, endMillis)
              if (Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
                  put(CalendarContract.Events.CALENDAR_ID, 3)
              } else {
                  put(CalendarContract.Events.CALENDAR_ID, 1)
              }
              put(CalendarContract.Events.TITLE, planName.value)
              put(CalendarContract.Events.EVENT_TIMEZONE, TimeZone.getDefault().id)
          }
          if (!PermissionUtils(context).checkPermission(PermissionUtils.WRITE_CALENDAR)) {
              context.contentResolver.insert(CalendarContract.Events.CONTENT_URI, values)
          }
      }
  </code></pre>
  
  <p>When I am trying to create an event, in few devices, events are created successfully and stays. </p>
  
  <p>But in few devices(eg. Samsung Galaxy J7 Prime) events are not created at all. The device in which events are not created, I am getting eventID after insert method.</p>
  
  <pre><code>var eventUri: Uri = context.contentResolver.insert(CalendarContract.Events.CONTENT_URI, values)
  </code></pre>
  
  <p>In <code>Huawei CAG-L22</code>, event is created but after few seconds, it disappears from the calendar.</p>
  
  <p>I am using the same code for all these devices.</p>
  
  <p>Can anyone help me with this? Please let me know if I am doing anything wrong.</p>
  
  <p>Thank you in advance.</p>