如何从Android应用程序更新自定义日历上的多个来宾

问题描述 投票:0回答:1

下面为自定义日历上的更新来宾添加了示例代码。但我想从Android应用程序更新多个客人。

ContentValues attValues = new ContentValues();
attValues.put(CalendarContract.Attendees.ATTENDEE_NAME, "RRD Attendees");
attValues.put(CalendarContract.Attendees.ATTENDEE_EMAIL, "[email protected]");
attValues.put(CalendarContract.Attendees.ATTENDEE_RELATIONSHIP, CalendarContract.Attendees.RELATIONSHIP_NONE);
attValues.put(CalendarContract.Attendees.ATTENDEE_TYPE, CalendarContract.Attendees.TYPE_REQUIRED);
attValues.put(CalendarContract.Attendees.ATTENDEE_STATUS, CalendarContract.Attendees.ATTENDEE_STATUS_INVITED);
attValues.put(CalendarContract.Attendees.EVENT_ID, eventID);
Uri uri = cr.insert(CalendarContract.Attendees.CONTENT_URI, attValues);
android google-calendar-api
1个回答
0
投票

尝试使用Batch Requests

客户端所做的每个HTTP连接都会产生一定的开销。 Google Calendar API支持批处理,允许您的客户端将多个API调用放入单个HTTP请求中。

您可能希望使用批处理的情况示例:

您刚刚开始使用API​​,并且您需要上传大量数据。用户在应用程序脱机(从Internet断开连接)时对数据进行了更改,因此您的应用程序需要通过发送大量更新和删除来将其本地数据与服务器同步。

© www.soinside.com 2019 - 2024. All rights reserved.