title: Adding result return to BarcodeEye (ZXing glass port), what is the result location?
body: <p>I am trying to create a Glass app which scans a barcode and uses the information in the barcode to open a specific document.</p>
  
  <p>After having trouble building ZXing from source for Glass, I turned to an already created port called BarcodeEye: <a href="https://github.com/BarcodeEye/BarcodeEye" rel="nofollow">https://github.com/BarcodeEye/BarcodeEye</a></p>
  
  <p>However, it seems that BarcodeEye does not have built in support for using it as an intent. I added the intent-action to the manifest. This allows me to call BarcodeEye from my app, but I am having trouble with where to call setResult in order to get a result with the text of my QR from barcodeEye.</p>
  
  <p>Can anybody with experience with ZXing help me to understand why there is no result returned and where to put the setResult code to properly return a result.</p>
  
  <p>Here is the code I am using to call BarcodeEye in my app:</p>
  
  <pre><code>    Intent intent = new Intent("com.github.barcodeeye.SCAN");
         intent.putExtra("SCAN_MODE", "QR_CODE_MODE");//for Qr code, its "QR_CODE_MODE" instead of "PRODUCT_MODE"
         intent.putExtra("SAVE_HISTORY", false);//this stops saving ur barcode in barcode scanner app's history
         startActivityForResult(intent, 0);
  </code></pre>
  
  <p>And here is my result class:</p>
  
  <pre><code> protected void onActivityResult(int requestCode, int resultCode, Intent data) {
          super.onActivityResult(requestCode, resultCode, data);
          if (requestCode == 0) {
              if (resultCode == RESULT_OK) {
                      String contents = data.getStringExtra("SCAN_RESULT"); //this is the result
                      Log.v("zxing",contents);
              } else 
              if (resultCode == RESULT_CANCELED) {
                // Handle cancel
              }
          }
      }
  </code></pre>
  
  <p>Any help with how to get the proper activity result would be greatly appreciated.</p>
  
  <p>EDIT: </p>
  
  <p>I was able to get it barely working by adding the intent filter and putting the data return in the <code>CaptureActivity.java</code> class. This works for me since the QR's I care about are text only, but I don't think my current method would work in some cases since it doesn't run it through the filter to check what type of QR it is. </p>
  
  <p>Here is my manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.chut.glass.xively"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="15"
          android:targetSdkVersion="15" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher_xi"
          android:label="@string/app_name" &gt;
  
          &lt;uses-library
              android:name="com.google.android.glass"
              android:required="true" /&gt;
  
          &lt;activity
              android:name="com.chut.glass.xively.MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="com.google.android.glass.action.VOICE_TRIGGER" /&gt;
                  &lt;category android:name="android.intent.category.DEFAULT" /&gt;
              &lt;/intent-filter&gt;
              &lt;meta-data
                  android:name="com.google.android.glass.VoiceTrigger"
                  android:resource="@xml/voice_trigger" /&gt;
          &lt;/activity&gt;
  
          &lt;service android:name="com.jessefarebro.mqtt.MqttService" android:exported="false" /&gt;
  
      &lt;/application&gt;
  
  
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Here is where I ended up putting the data return in CaputreActivity:</p>
  
  <pre><code>// Put up our own UI for how to handle the decoded contents.
  private void handleDecodeInternally(Result rawResult, Bitmap barcode) {
  
      Uri imageUri = null;
      String imageName = IMAGE_PREFIX + System.currentTimeMillis() + ".png";
      Log.v(TAG, "Saving image as: " + imageName);
      try {
          imageUri = mImageManager.saveImage(imageName, barcode);
      } catch (IOException e) {
          Log.e(TAG, "Failed to save image!", e);
      }
  
      ResultProcessor&lt;?&gt; processor = ResultProcessorFactory
              .makeResultProcessor(this, rawResult, imageUri);
  
      Intent data = new Intent();
      data.putExtra("SCAN_RESULT", rawResult.toString());
     if (getParent() == null) {
         setResult(Activity.RESULT_OK, data);
         Log.v(TAG,"parent null");
     } else {
         Log.v(TAG,"parent: " + getParent());
         getParent().setResult(Activity.RESULT_OK, data);
     }
     Log.v(TAG,"about to finish");
     finish();
     Log.v(TAG,"post finish");
  
      //startActivity(ResultsActivity.newIntent(this, processor.getCardResults(), imageUri));
  }
  </code></pre>