java - 如何将要同步的电子邮件 ID 传递到 android 中的创建事件日历中?

标签 java android calendar

如何通过email将要同步的日历的mail id传入create事件? 我有一个微调器,显示要同步的帐户列表,如下图所示。现在,像往常一样传递标题、描述以在日历应用程序中创建事件,我使用以下代码。

ContentValues values = new ContentValues();
    values.put("calendar_id", 1);
    values.put("title", title1);
    values.put("allDay", 0);
    values.put("dtstart", settime);
    values.put("dtend", cal.getTimeInMillis()+60*60*1000); 
    values.put("description", desc1);
    values.put("???????", mail_id);
    values.put("???????", participant_mail_id);
    values.put("visibility", 0);
    values.put("hasAlarm", 1);
    event = cr.insert(EVENTS_URI, values);

我应该使用什么来传递 key 以插入电子邮件 ID 和参与者 ID?非常感谢任何帮助。我的屏幕截图如下。

enter image description here

最佳答案

How to pass the mail id of the calendar that to be synchronized

事件通过“calendar_id”链接到日历。要获得“calendar_id”,您应该查询所有用户的日历,然后在结果中搜索您感兴趣的姓名。这是一个应该有帮助的教程:Working with the Android Calendar

或者,您可以创建一个事件,然后让用户选择应该将事件添加到哪个日历:Adding Calendar event through Intent

关于java - 如何将要同步的电子邮件 ID 传递到 android 中的创建事件日历中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7445572/

相关文章:

java - 我想使用 json 将 Listview 数据发送到 Android 中的另一个 Activity

java - Elasticsearch XContent Provider

android - 如何从 Listview, Android 中删除适配器

android - Activity 似乎是在应用程序对象之前创建的

c# - WPF "Calendar only month"在悬停时触发 DisplayDateChanged

c# - 按住鼠标的 WPF 日历控件

android - Google 日历崩溃,因为我添加了一个结束时间早于开始时间的事件

java - 使用匹配器/模式从 http 文档中提取字符串

java - Cucumber,Java Picocontainer/Constructor注入(inject): TestContext & ScenarioContext),如何在多个步骤定义之间共享多个数据

java - 无法生成固定大小的字母数字符号字符串