};
add(prevLink);
+ // Avoid implicit references to the album to keep the link objects
+ // small and serializable.
+ final int albumSize = album.size();
Link nextLink = new Link("nextLink") {
{
- if (index + MAX_ROWS * MAX_COLUMNS >= album.size()) {
+ if (index + MAX_ROWS * MAX_COLUMNS >= albumSize) {
setEnabled(false);
}
}