question

rachitk3 avatar image
rachitk3 asked

Barcode scanner on register redirecting to add item page of inventory

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);
            }
        }
    }

};
Clover Minibarcode scanner
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community