【发布时间】:2013-02-11 07:28:24
【问题描述】:
我正在用 Java 进行 Google 日历同步,遇到这样的问题: 我必须将 EventDateTime(GenericJson 的子类)发布到 Google 以同步时间。特别是在我的情况下,我必须清除“日期”字段,并设置“日期时间”字段。
//code to init the variable dateTime, in the form of google DateTime
EventDateTime edt = new EventDateTime();
edt.put("dateTime", dateTime);
edt.put("date", null);
当我使用上面的代码时,edt 中的地图只显示 1 个<key,value> 对:<dateTime,some date>。没有值对<date,null>。
有人经历过吗?请帮助我解决方法。 tks。
更新:这个工作:edt.put ("date", Data.NULL_DATE_TIME),想法是进入Data的代码,找到对应的字段NULL_XXX并选择你需要的。
【问题讨论】:
标签: google-api-java-client google-api-client