Android工程中使用Google calendar API时 Query出错
模仿Sample在Android上做一个获取Calendar 的例子。
只执行printAllEvents(myService) OK, 没有问题
只执行dateRangeQuery OK, 也没有问题
如下,先执行printAllEvents(myService), 再执行dateRangeQuery 的话, 到service.query(myQuery, CalendarEventFeed.class);这步就跳到Source no fond 了
这是怎么回事啊??
CalendarService myService = new CalendarService("CalendarTest-1"); try { myService.setUserCredentials("username", "password"); System.out.println("Printing all events"); printAllEvents(myService); //获得所有Events dateRangeQuery(myService,DateTime.parseDate("2010-03-01"), DateTime .parseDate("2010-03-01")) //查询指定日期Event } catch (AuthenticationException e) { e.printStackTrace(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (ServiceException e) { e.printStackTrace(); } private void dateRangeQuery(CalendarService service, DateTime startTime, DateTime endTime) { CalendarQuery myQuery = new CalendarQuery(eventFeedUrl); myQuery.setMinimumStartTime(startTime); myQuery.setMaximumStartTime(endTime); // Send the request and receive the response: try { CalendarEventFeed resultFeed = service.query(myQuery, CalendarEventFeed.class); //出错 } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (ServiceException e) { // TODO Auto-generated catch block e.printStackTrace(); } }