FAQ

Attributes missing from Photo's

This call to userName always returns an empty string.
Other attributes also don't contain the expected value.
What's wrong?

PhotoList photos = photoInt.search(params, 500, 1);
Iterator itr = photos.iterator();
while (itr.hasNext()) {
       Photo p = itr.next();
       username = p.getOwner().getUserName();
       System.out.println("user name is "+username);
}
In a PhotoList you get just a minimal Photo-object.
You have to call PhotosInterface#getInfo() to get all attributes of a Photo.
Or to get the Owner-information:
User user = flickr.getPeopleInterface.getInfo(p.getOwner().getId());
«« back