Back to project page GlassCounter.
The source code is released under:
Apache License
If you think the Android project GlassCounter listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.github.barcodeeye.scan.result.internal; /*from w w w. j a v a2 s . co m*/ import java.util.ArrayList; import java.util.List; import android.content.Context; import android.content.Intent; import android.net.Uri; import com.github.barcodeeye.scan.api.CardPresenter; import com.github.barcodeeye.scan.result.ResultProcessor; import com.google.zxing.Result; import com.google.zxing.client.result.ParsedResult; public class TextResultProcessor extends ResultProcessor<ParsedResult> { private static final String SEARCH_URL = "https://www.google.com/search?q=%s"; public TextResultProcessor(Context context, ParsedResult parsedResult, Result result, Uri photoUri) { super(context, parsedResult, result, photoUri); } @Override public List<CardPresenter> getCardResults() { List<CardPresenter> cardPresenters = new ArrayList<CardPresenter>(); ParsedResult parsedResult = getParsedResult(); String codeValue = parsedResult.getDisplayResult(); CardPresenter cardPresenter = new CardPresenter(); cardPresenter.setText("Search Web").setFooter(codeValue); Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(String.format(SEARCH_URL, codeValue))); cardPresenter.setPendingIntent(createPendingIntent(getContext(), intent)); cardPresenters.add(cardPresenter); return cardPresenters; } }