@Override protected final void onPostExecute(Object arg) { TextView textView = textViewRef.get(); if (textView != null) { for (CharSequence content : newContents) { textView.append(content); } textView.setMovementMethod(LinkMovementMethod.getInstance()); } HistoryManager historyManager = historyManagerRef.get(); if (historyManager != null) { for (String[] text : newHistories) { historyManager.addHistoryItemDetails(text[0], text[1]); } } }
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); fakeR = new FakeR(this); Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(fakeR.getId("layout", "capture")); hasSurface = false; historyManager = new HistoryManager(this); historyManager.trimHistory(); inactivityTimer = new InactivityTimer(this); beepManager = new BeepManager(this); PreferenceManager.setDefaultValues(this, fakeR.getId("xml", "preferences"), false); //showHelpOnFirstLaunch(); }
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)); } }
@Override protected void onPostExecute(Object arg) { TextView textView = textViewRef.get(); if (textView != null) { for (Spannable content : newContents) { textView.append(content); } textView.setMovementMethod(LinkMovementMethod.getInstance()); } HistoryManager historyManager = historyManagerRef.get(); if (historyManager != null) { for (String[] text : newHistories) { historyManager.addHistoryItemDetails(text[0], text[1]); } } }
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(R.layout.capture); hasSurface = false; historyManager = new HistoryManager(this); historyManager.trimHistory(); inactivityTimer = new InactivityTimer(this); beepManager = new BeepManager(this); ambientLightManager = new AmbientLightManager(this); PreferenceManager.setDefaultValues(this, R.xml.preferences, false); }
@Override public void onCreate(Bundle icicle) { super.onCreate(icicle); Window window = getWindow(); window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); setContentView(R.layout.capture); hasSurface = false; historyManager = new HistoryManager(this); historyManager.trimHistory(); inactivityTimer = new InactivityTimer(this); beepManager = new BeepManager(this); ambientLightManager = new AmbientLightManager(this); PreferenceManager.setDefaultValues(this, R.xml.preferences, false); showHelpOnFirstLaunch(); }
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)); } }
@Override protected final void onPostExecute(Object arg) { TextView textView = textViewRef.get(); if (textView != null) { for (Spannable content : newContents) { textView.append(content); } textView.setMovementMethod(LinkMovementMethod.getInstance()); } HistoryManager historyManager = historyManagerRef.get(); if (historyManager != null) { for (String[] text : newHistories) { historyManager.addHistoryItemDetails(text[0], text[1]); } } }