Double-check to avoid exception clicking on stale item

git-svn-id: https://zxing.googlecode.com/svn/trunk@2261 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2012-04-26 16:31:31 +00:00
parent 8f461afd09
commit 9ad25e25b7

View file

@ -40,7 +40,11 @@ final class BrowseBookListener implements AdapterView.OnItemClickListener {
// Clicked header, ignore it
return;
}
String pageId = items.get(position - 1).getPageId();
int itemOffset = position - 1;
if (itemOffset >= items.size()) {
return;
}
String pageId = items.get(itemOffset).getPageId();
String query = SearchBookContentsResult.getQuery();
if (LocaleManager.isBookSearchUrl(activity.getISBN()) && pageId.length() > 0) {
String uri = activity.getISBN();