diff --git a/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java b/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java index 8991a8935..619891f09 100644 --- a/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java +++ b/android/src/com/google/zxing/client/android/result/supplement/ProductResultInfoRetriever.java @@ -22,7 +22,6 @@ import android.util.Log; import android.widget.TextView; import com.google.zxing.client.android.AndroidHttpClient; import com.google.zxing.client.android.LocaleManager; -import com.google.zxing.client.result.ProductParsedResult; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; @@ -47,17 +46,16 @@ final class ProductResultInfoRetriever extends SupplementalInfoRetriever { Pattern.compile("owb63p\">([^<]+).+zdi3pb\">([^<]+)"); - private final ProductParsedResult result; + private final String productID; - ProductResultInfoRetriever(TextView textView, ProductParsedResult result, Handler handler, Context context) { + ProductResultInfoRetriever(TextView textView, String productID, Handler handler, Context context) { super(textView, handler, context); - this.result = result; + this.productID = productID; } @Override void retrieveSupplementalInfo() throws IOException, InterruptedException { - String productID = result.getProductID(); String encodedProductID = URLEncoder.encode(productID, "UTF-8"); String uri = BASE_PRODUCT_URI + encodedProductID; diff --git a/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java b/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java index bb16337af..64b6032b0 100644 --- a/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java +++ b/android/src/com/google/zxing/client/android/result/supplement/SupplementalInfoRetriever.java @@ -24,6 +24,7 @@ import android.text.Html; import android.text.Spanned; import android.view.View; import android.widget.TextView; +import com.google.zxing.client.result.ISBNParsedResult; import com.google.zxing.client.result.ParsedResult; import com.google.zxing.client.result.ProductParsedResult; import com.google.zxing.client.result.URIParsedResult; @@ -59,7 +60,9 @@ public abstract class SupplementalInfoRetriever implements Callable { if (result instanceof URIParsedResult) { retriever = new URIResultInfoRetriever(textView, (URIParsedResult) result, handler, context); } else if (result instanceof ProductParsedResult) { - retriever = new ProductResultInfoRetriever(textView, (ProductParsedResult) result, handler, context); + retriever = new ProductResultInfoRetriever(textView, ((ProductParsedResult) result).getProductID(), handler, context); + } else if (result instanceof ISBNParsedResult) { + retriever = new ProductResultInfoRetriever(textView, ((ISBNParsedResult) result).getISBN(), handler, context); } if (retriever != null) { ExecutorService executor = getExecutorService();