【问题描述】
Android应用插入日历返回的Uri为空(仅在鸿蒙系统出现)
val values = ContentValues().appl y {
put(CalendarContract.Reminders.EVENT_ID, ContentUris.parseId(newEvent))
// put(CalendarContract.Reminders.MINUTES, 10) // 提前previousDate天有提醒
put(CalendarContract.Reminders.METHOD, CalendarContract.Reminders.METHOD_ALERT)
}
val uri = context.contentResolver.insert(CalendarContract.Reminders.CONTENT_URI, values)
//此处鸿蒙系统报错
![](/i/l/?n=22&i=blog/1969374/202209/1969374-20220921090039856-741245648.gif)
【解决方案】
取消掉已注释掉的这行代码即可
欲了解更多更全技术文章,欢迎访问https://developer.huawei.com/consumer/cn/forum/?ha_source=zzh
标签:CalendarContract,日历,Reminders,Uri,为空,Android From: https://www.cnblogs.com/developer-huawei/p/16714378.html