private void onBarcodeDetected(Barcode barcode) {
    Log.d(TAG, "Detected barcode with value: " + barcode.displayValue);

    Intent returnIntent = new Intent();
    returnIntent.putExtra(INTENT_EXTRA_BARCODE_VALUE, barcode.displayValue);
    setResult(RESULT_OK, returnIntent);
    finish();
  }
Returns the detected barcode value to the caller activity.
java/com/google/android/apps/authenticator/barcode/BarcodeCaptureActivity.java