Skip to content

Commit

Permalink
Allow not showing the scanned text #5
Browse files Browse the repository at this point in the history
  • Loading branch information
EddyVerbruggen committed Dec 22, 2016
1 parent a35cee7 commit 4fc064b
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -665,12 +665,18 @@ private void handleDecodeExternally(Result rawResult, ResultHandler resultHandle
viewfinderView.drawResultBitmap(barcode);
}

long resultDurationMS;
if (getIntent() == null) {
resultDurationMS = DEFAULT_INTENT_RESULT_DURATION_MS;
} else {
resultDurationMS = getIntent().getLongExtra(Intents.Scan.RESULT_DISPLAY_DURATION_MS,
DEFAULT_INTENT_RESULT_DURATION_MS);
long resultDurationMS = DEFAULT_INTENT_RESULT_DURATION_MS;
if (getIntent() != null) {
if (getIntent().hasExtra(Intents.Scan.RESULT_DISPLAY_DURATION_MS)) {
final String durationStr = getIntent().getStringExtra(Intents.Scan.RESULT_DISPLAY_DURATION_MS);
if (durationStr != null) {
try {
resultDurationMS = Long.parseLong(durationStr);
} catch (NumberFormatException e) {
Log.e(TAG, "Could not parse " + durationStr + " to Long", e);
}
}
}
}

if (resultDurationMS > 0) {
Expand Down

0 comments on commit 4fc064b

Please sign in to comment.