我有一个 CalendarEntry 对象
我知道 http://www.google.com/calendar/feeds/example@gmail.com/allcalendars/full 是所有日历的 feed url
但是我如何从 CalendarEntry 实例中获取这个提要 url?
因为我想在指定的日历中发布新条目并且我需要这个 url。
谢谢!
最佳答案
我建议您在代码中指定该 URL,如以下代码段:
CalendarService myService = new CalendarService("CalendarService");
myService.setUserCredentials("example@gmail.com", "yourPassword");
URL feedUrl = new URL("http://www.google.com/calendar/feeds/default/allcalendars/full");
CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class);
System.out.println("Your calendars:");
for (int i = 0; i < resultFeed.getEntries().size(); i++) {
CalendarEntry entry = resultFeed.getEntries().get(i);
System.out.println("\t" + entry.getTitle().getPlainText());
}
CalendarEntry 实例将存储通过指定 URL 检索到的每个日历(主日历、辅助日历、导入日历)。
关于java - 谷歌日历java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1928549/