Android开发:从Google日历中获取任务(或提醒)
我和Java和Android Studio一起摆弄。 我设法从Google日历中阅读,使用Google的ContentResolver获取事件 - 一切都很好。
Cursor cursor = contentResolver.query(
CalendarContract.Events.CONTENT_URI,
new String[]{"title", "dtstart", "dtend"},
"( dtstart >" + startFrom.getTimeInMillis()
+ " and dtend <" + endAt.getTimeInMillis()
+ " and deleted != 1 )",
null,
"dtstart ASC"
);
现在,我也从Google日历中尝试了获取任务。当您将新项目添加到日历中,而不是事件时,您还可以创建“任务”(或“提醒”)。
看起来,日历中没有存储(?)
如何获取这些任务(或提醒)是在我的软件中使用日历应用程序创建的?
PS:如果提醒,请不要谈论这里的活动。但是关于代表自己的提醒,独立于事件。
I am fiddling around with java and Android Studio.
I managed to read from the Google Calendar, fetching Events using the ContentResolver from Google - all fine.
Cursor cursor = contentResolver.query(
CalendarContract.Events.CONTENT_URI,
new String[]{"title", "dtstart", "dtend"},
"( dtstart >" + startFrom.getTimeInMillis()
+ " and dtend <" + endAt.getTimeInMillis()
+ " and deleted != 1 )",
null,
"dtstart ASC"
);
Now I am trying the fetch Tasks as well, from the Google Calendar. When you're adding a new item to your calendar, instead of Events, you can also create "Tasks" (or "Reminders").
As it seems, there are not stored in the calendar directly(?)
How can I fetch these Tasks (or Reminders) that were created using the calendar app, within my software?
PS: In case of reminders, not talking about reminders for an event here. But about reminders that stand for themselves, independent of an event.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论