Android开发:从Google日历中获取任务(或提醒)

发布于 2025-02-12 12:20:59 字数 820 浏览 1 评论 0原文

我和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").

enter image description here

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文