public static void maybeInvokeRetrieval(TextView textView, ParsedResult result, HistoryManager historyManager, Context context) { AsyncTaskExecInterface taskExec = new AsyncTaskExecManager().build(); if (result instanceof URIParsedResult) { taskExec.execute(new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context)); taskExec.execute(new TitleRetriever(textView, (URIParsedResult) result, historyManager)); } else if (result instanceof ProductParsedResult) { String productID = ((ProductParsedResult) result).getProductID(); taskExec.execute(new ProductResultInfoRetriever(textView, productID, historyManager, context)); } else if (result instanceof ISBNParsedResult) { String isbn = ((ISBNParsedResult) result).getISBN(); taskExec.execute(new ProductResultInfoRetriever(textView, isbn, historyManager, context)); taskExec.execute(new BookResultInfoRetriever(textView, isbn, historyManager, context)); } }
public static void maybeInvokeRetrieval(TextView textView, ParsedResult result, HistoryManager historyManager, Context context) { AsyncTaskExecInterface taskExec = new AsyncTaskExecManager().build(); if (result instanceof URIParsedResult) { taskExec.execute(new URIResultInfoRetriever(textView, (URIParsedResult) result, historyManager, context)); taskExec.execute(new TitleRetriever(textView, (URIParsedResult) result, historyManager)); } else if (result instanceof ProductParsedResult) { String productID = ((ProductParsedResult) result).getProductID(); taskExec.execute(new ProductResultInfoRetriever(textView, productID, historyManager, context)); switch (productID.length()) { case 12: taskExec.execute(new AmazonInfoRetriever(textView, "UPC", productID, historyManager, context)); break; case 13: taskExec.execute(new AmazonInfoRetriever(textView, "EAN", productID, historyManager, context)); break; } } else if (result instanceof ISBNParsedResult) { String isbn = ((ISBNParsedResult) result).getISBN(); taskExec.execute(new ProductResultInfoRetriever(textView, isbn, historyManager, context)); taskExec.execute(new BookResultInfoRetriever(textView, isbn, historyManager, context)); taskExec.execute(new AmazonInfoRetriever(textView, "ISBN", isbn, historyManager, context)); } }