Fixed book search browsing

git-svn-id: https://zxing.googlecode.com/svn/trunk@1901 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2011-09-02 10:02:02 +00:00
parent 9278059461
commit 12cdb98b81
2 changed files with 6 additions and 5 deletions

View file

@ -35,12 +35,13 @@ final class BrowseBookListener implements AdapterView.OnItemClickListener {
}
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
// HACK(jbreiden) I have no idea where the heck our pageId off by one
// error is coming from. I should not have to put in this position - 1
// kludge.
if (position < 1) {
// Clicked header, ignore it
return;
}
String pageId = items.get(position - 1).getPageId();
String query = SearchBookContentsResult.getQuery();
if (activity.getISBN().startsWith("http://google.com/books?id=") && (pageId.length() > 0)) {
if (LocaleManager.isBookSearchUrl(activity.getISBN()) && pageId.length() > 0) {
String uri = activity.getISBN();
int equals = uri.indexOf('=');
String volumeId = uri.substring(equals + 1);

View file

@ -259,7 +259,7 @@ public final class SearchBookContentsActivity extends Activity {
// break or disappear at any time in the future. Since this is an API call rather than a
// website, we don't use LocaleManager to change the TLD.
URI uri;
if (isbn.startsWith("http://google.com/books?id=")) {
if (LocaleManager.isBookSearchUrl(isbn)) {
int equals = isbn.indexOf('=');
String volumeId = isbn.substring(equals + 1);
uri = new URI("http", null, "www.google.com", -1, "/books", "id=" + volumeId +