Hi Team,
I am using BarcodeScanner class to scan barcodes but on the register, after getting the result in the broadcast receiver it redirects me to add item page of the inventory. But I don't want it. How can I stop this?
private void registerBarcodeScanner() { if(!isBarCodeRegisterd) { registerReceiver(barcodeReceiver, new IntentFilter(BarcodeResult.INTENT_ACTION)); isBarCodeRegisterd =true; }
Bundle extras = new Bundle(); extras.putBoolean(Intents.EXTRA_LED_ON, false); extras.putBoolean(Intents.EXTRA_SCAN_QR_CODE, true); extras.putBoolean(Intents.EXTRA_SCAN_1D_CODE, true); mBarcodeScanner.executeStartScan(extras);
private final BroadcastReceiver barcodeReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { invalidateCustomerWidget(); BarcodeResult barcodeResult = new BarcodeResult(intent); if (barcodeResult.isBarcodeAction()) { String barcode = barcodeResult.getBarcode(); if (barcode != null && !barcode.isEmpty()) { displayBarcode(barcode); } } } };