我在这里遇到了与 simplei 完全相同的问题。看来他从来没有得到回答,我在这个网站上找不到这个问题,所以我想我会把它放在这个社区面前。
无论出于何种原因,GphotoEntry 都有效,但 PhotoEntry 什么也不返回。我需要在 PhotoEntry 上使用 getMediaSource() 方法;它不适用于 GphotoEntry。
这是我的代码(它必须在 try-catch 语句中,但我已经把它拿出来了)。你会注意到我已经注释掉了对我有用的行:
URL baseSearchUrl = new URL("https://picasaweb.google.com/data/feed/api/all");
Query myQuery = new Query(baseSearchUrl);
myQuery.setStringCustomParameter("kind", "photo");
myQuery.setMaxResults(10);
myQuery.setFullTextQuery("puppy");
AlbumFeed searchResultsFeed = myService.query(myQuery, AlbumFeed.class);
//for (GphotoEntry photo : searchResultsFeed.getEntries()) {
for (PhotoEntry photo : searchResultsFeed.getPhotoEntries()) {
System.out.println(photo.getTitle().getPlainText());
}
我感谢您的帮助