@Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data); if (requestCode==0){ if (result != null) { if (result.getContents() == null) { Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show(); } else { String scannedValue = result.getContents(); parentFirstBarCode.setText(scannedValue); String scannedValueLength = String.valueOf(scannedValue.length()); Toast.makeText(getApplicationContext(), "Length of the scanned code:" + scannedValueLength, Toast.LENGTH_SHORT).show(); operationsAfterScan(scannedValue); } } else { // This is important, otherwise the result will not be passed to the fragment super.onActivityResult(requestCode, resultCode, data); } } if (requestCode==1){ if (result != null) { if (result.getContents() == null) { Toast.makeText(this, "Cancelled", Toast.LENGTH_LONG).show(); } else { String scannedValue = result.getContents(); parentSecondBarCode.setText(scannedValue); String scannedValueLength = String.valueOf(scannedValue.length()); Toast.makeText(getApplicationContext(), "Length of the scanned code:" + scannedValueLength, Toast.LENGTH_SHORT).show(); operationsAfterScan(scannedValue); } } else { // This is important, otherwise the result will not be passed to the fragment super.onActivityResult(requestCode, resultCode, data); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)