Open Flatc4t opened 2 years ago
Sorry for the delay.
The SCAN Intent is for scanning with the camera only.
At the moment there is no corresponding Intent to scan from a picture, sorry. But I could add one if you still need this?
However, the Activity will not return immediately after a scan like it does with the camera because there can be multiple barcodes on a picture, and the Picker is meant to let the user choose the right one. So a user would have to tap on the floating action button with the magnifying glass before the result is returned.
not going to lie, I'd love the functionality but I've made a work around currently. Doesn't do what I want perfectly but I end up with the same result.
Sorry - very beginner at programming so this may be a simple answer. Currently have made an app that reads a QR code live via the camera, and returns the result back to the app via code below, no issues.
However, if I am trying to read a QR code from a stored picture I can feel the phone vibrate as it detects the code, but it does not return a result back to the app. Is that a different process than via the camera?
thanks
val getResult = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result -> if (result.resultCode == Activity.RESULT_OK) { val editText = result.data?.getStringExtra("SCAN_RESULT") val ddQRCode = editText.toString()