title: Android Vision Api - Barcode Formats
body: <p>I have followed <a href="https://github.com/wax911/Vision-Barcode-Scanner/tree/master/barcode-reader/app/src/main/java/com/google/android/gms/samples" rel="nofollow noreferrer">https://github.com/wax911/Vision-Barcode-Scanner/tree/master/barcode-reader/app/src/main/java/com/google/android/gms/samples</a> this git to implement vision api into my application. I can successfully detect the bar code and QR code, but facing problem with the formats. Below is my implementation: </p>
  
  <p>BarCode initialization:</p>
  
  <pre><code> BarcodeDetector barcodeDetector = new BarcodeDetector.Builder(context).setBarcodeFormats(Barcode.QR_CODE |
                  Barcode.DATA_MATRIX | Barcode.UPC_E | Barcode.UPC_A | Barcode.CODABAR).build();
          BarcodeTrackerFactory barcodeFactory = new BarcodeTrackerFactory(mGraphicOverlay, autoCapture ? this : null);
          barcodeDetector.setProcessor(
                  new MultiProcessor.Builder&lt;&gt;(barcodeFactory).build());
  </code></pre>
  
  <p>After barcode detection, I am trying to identify the format which is been detected.Below is the code </p>
  
  <pre><code>public void updateList(Detector.Detections&lt;Barcode&gt; barcodeList) {
      this.barcodeList = barcodeList;
      final SparseArray&lt;Barcode&gt; detectedItems = barcodeList.getDetectedItems();
      for (int i = 0; i &lt; detectedItems.size(); i++) {
          Log.e("Value", "------&gt;" + detectedItems.valueAt(i));
          final Barcode barcode = detectedItems.valueAt(i);
          final int value = detectedItems.valueAt(i).valueFormat;
          switch (value) {
              case Barcode.DATA_MATRIX:
                  Log.i("Value", barcode.rawValue);
                  break;
              case Barcode.QR_CODE:
                  Log.i("Value", barcode.rawValue);
                  break;
              case Barcode.CODABAR:
                  Log.i("Value", barcode.rawValue);
                  break;
              case Barcode.UPC_E:
                  Log.i("Value", barcode.rawValue);
                  break;
              case Barcode.UPC_A:
                  Log.i("Value", barcode.rawValue);
                  break;
              case Barcode.TEXT:
                  Log.i("Value", barcode.rawValue);
                  break;
          }
      }
  
      final String noItems = detectedItems.toString();
  }
  </code></pre>
  
  <p>My problem is whenever I scan the QR code format result is 'Codabar' instead of QRcode, also whenever I scan barcode the formatted result is 'TEXT' instead of <em>UPC_E</em> or <em>UPC_A</em></p>
  
  <p>Please help.</p>