I’m using ZXing API.
I have the following code:
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v){
IntentIntegrator integrator = new IntentIntegrator(activity);
integrator.setDesiredBarcodeFormats(IntentIntegrator.QR_CODE_TYPES);
integrator.setCameraId(0);
integrator.setOrientationLocked(true);
integrator.setPrompt("Para usar o flash utilizar os botões do volume");
integrator.initiateScan();
However, I don’t know how to publish the initiateScan using the ActivityResultLauncher mGetContent = registerForActivityResult(new ActivityResultContracts.GetContent().
Could you please help me?
Kind regards,
2
Answers
I add:
and:
But the ActivityResultLauncher.launch(integrator) doesn't work.
You can launch scanner with ‘integrator.createScanIntent()’.
activityResultLaucher.launch(integrator.createScanIntent());