如何将要同步的电子邮件 ID 传递到 Android 中的创建事件日历中?
如何通过电子邮件将要同步的日历的邮件ID传递到创建事件中? 我有一个微调器,显示要同步的帐户列表,如下图所示。现在,像往常一样传递标题、描述以在日历应用程序中创建事件,我使用以下代码。
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);
我应该使用什么来传递插入电子邮件 ID 和参与者 ID 的密钥?非常感谢任何帮助。我的屏幕截图如下。
How to pass the mail id of the calendar that to be synchronized into the create event through email?
I have a spinner that shows the list of accounts to be synchronized as below picture. Now, as usual passing title,description to create event in calendar application, i use following code.
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);
What should i use to pass the key to insert email id and participant id? Any Help is really appreciated. My screen shot goes below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该事件通过“calendar_id”链接到日历。要获取“calendar_id”,您应该查询所有用户的日历,然后在结果中搜索您感兴趣的名称。这是一个应该有所帮助的教程: 使用 Android 日历
或者,您可以创建一个事件,然后让用户选择该事件应添加到哪个日历:通过Intent添加日历事件
The event is linked to a calendar by the "calendar_id". To get the "calendar_id" you should query for all the user's calendars and then search results for name in which you are interested. Here is a tutorial which should help: Working with the Android Calendar
Alternatively, you can create an event and then let the user choose to which Calendar the event should be added: Adding Calendar event through Intent