为更新日历事件添加通知时添加备注。
代码示例:
// 获取日历事件的管理器
CalendarManager calendarManager = context.getSystemService(CalendarManager.class);
// 获取要更新的日历事件
CalendarEvent event = calendarManager.getEvent(eventId);
// 设置通知
Notification notification = new Notification.Builder(context, channelId)
.setContentTitle(event.getTitle())
.setContentText(event.getDescription())
.setSmallIcon(R.drawable.notification_icon)
.addExtra(Notification.EXTRA_NOTE, "这是一条通知备注")
.build();
calendarManager.scheduleNotification(notification, event);