-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ActivityResultLauncher not run when i switch from other fragment #695
Comments
The same thing is working on the sample application: zxing-android-embedded/sample/src/main/java/example/zxing/MainActivity.java Lines 130 to 155 in 2324a54
I'd recommend creating a minimal application that can still reproduce the issue - remove the database and firebase logic, as well as any views not directly relevant to this. Then compare it to the sample application and see where it's different to isolate the cause. |
It still happen with the minimal application. |
My guess is it's something related to the Activity instead of the Fragment. Are you overriding the |
You're right about the error in the activity.
Thanks |
Description of the problem:
This app is for Attendance using barcode. I use firebase on this app.
The app work as intended, i can scan the barcode and save data to firebase.
But the problem is that when i open another Fragment or Activity then back to this Fragment, the scanner dont work as intended. It does open the camera but anything inside ActivityResultLauncher not working.
Closing and reopening the app will fix this until i change to other Fragment or Activity again.
Which library version are you using?
4.3.0
Does the same happen on other devices or an emulator?
Yes, bot emulator and my device.
Can you reproduce the issue in the sample project included with the library? If not, can you
provide your own sample project or sample code that produces this error?
This is the code on my fragment: https://pastebin.com/e7XZN08i
In the case of an error do you have a stack trace or adb logs?
I made some Logs to check on where the progress at.
This the log when working as intended:
2022-02-03 16:01:07.464 20399-20399 I/ContentValues: On Create .....
2022-02-03 16:01:07.471 20399-20399 I/ContentValues: On Start .....
2022-02-03 16:01:12.673 20399-20399 I/ContentValues: On Scanner Initialization.....
2022-02-03 16:01:12.683 20399-20399 I/ContentValues: On Pause .....
2022-02-03 16:01:13.776 20399-20399 I/ContentValues: On Stop .....
2022-02-03 16:01:17.328 20399-20399 I/ContentValues: On Start .....
2022-02-03 16:01:17.328 20399-20399 I/ContentValues: On Scanner Launcher.....
2022-02-03 16:01:21.320 20399-20399 I/ContentValues: On Pause .....
2022-02-03 16:01:21.323 20399-20399 I/ContentValues: On Stop .....
2022-02-03 16:01:21.376 20399-20399 I/ContentValues: On Destroy .....
This when it not working as intended:
2022-02-03 16:01:26.439 20399-20399 I/ContentValues: On Create .....
2022-02-03 16:01:26.441 20399-20399 I/ContentValues: On Start .....
2022-02-03 16:01:27.924 20399-20399 I/ContentValues: On Scanner Initialization.....
2022-02-03 16:01:27.931 20399-20399 I/ContentValues: On Pause .....
2022-02-03 16:01:28.841 20399-20399 I/ContentValues: On Stop .....
2022-02-03 16:01:30.567 20399-20399 I/ContentValues: On Start .....
2022-02-03 16:01:32.785 20399-20399 I/ContentValues: On Pause .....
2022-02-03 16:01:32.786 20399-20399 I/ContentValues: On Stop .....
2022-02-03 16:01:32.827 20399-20399 I/ContentValues: On Destroy .....
The text was updated successfully, but these errors were encountered: