0

I need help. I need to scan two barcodes at the same time. For now I can take one code at a time. I am desperate, I can't find a guide anywhere.

My code:


public void onclick_scan(View view){

    IntentIntegrator intentIntegrator = new IntentIntegrator(this);
    intentIntegrator.setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES);
    intentIntegrator.setPrompt("Scan");
    intentIntegrator.setBeepEnabled(true);
    intentIntegrator.setOrientationLocked(true);
    intentIntegrator.setCameraId(0);
    intentIntegrator.initiateScan();



}





@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    IntentResult intentResult = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
    if (intentResult != null) {
        String productId = intentResult.getContents();
        
        editText.setText(productId);
        
        Toast.makeText(getApplicationContext(), productId, Toast.LENGTH_LONG).show();
    }
}

Esabot
  • 1
  • 1

0 Answers0