Calendar returning duplicate Holiday Events

怎甘沉沦 提交于 2021-01-28 04:17:55

问题


I have found, that when has two accounts linked to their device, and both accounts are syncing their calendars, and both accounts are setup to show the Google Holiday calendar, then the `CalendarContract.Instances` is returning each holiday twice, once for each calendar. Therefore you will see in such cases, that most Calendar apps, other than Google Calendar, will show the Holiday twice, once per calendar.

I looked at the underlying Sqlite database, and in the `Calendar` table, there is a separate row for each holiday calendars, with different ids. In the `Events` table, and in the `instances` table, there are 2 rows for each holiday, one for each calendar, with different ids. So `CalendarContract.Instances` is returning the expected results.

The question is, how does the Google Calendar avoid this? Does it do it just by comparing the titles of allDay events, and not showing duplicates? Sounds risky to me. Any ideas?

Thanks in advance


回答1:


I did some hacking by changing the title in the underlying database, and then Google Calendar app did show the event twice. So obviously, the Google app, is just comparing details (either in code or in query), and not showing the ones that look like duplicates.



来源:https://stackoverflow.com/questions/46940047/calendar-returning-duplicate-holiday-events

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!