One Last Bit of Flickr Data
Update GalleryItem to put this plan into action.
Listing 30.1 Adding code for photo page (GalleryItem.java)
public class GalleryItem {
private String mCaption;
private String mId;
private String mUrl;
private String mOwner;
...
public void setUrl(String url) {
mUrl = url;
}
public String getOwner() {
return mOwner;
}
public void setOwner(String owner) {
mOwner = owner;
}
public Uri getPhotoPageUri() {
return Uri.parse("https://www.flickr.com/photos/")
.buildUpon()
.appendPath(mOwner)
.appendPath(mId)
.build();
}
@Override
public String toString() {
return mCaption;
}
}
Here, you create a new mOwner property and add a short method called getPhotoPageUri() to generate
photo page URLs as discussed above.