Skip to content
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

Fix scanning not running when calling StartScanning #965

Merged
merged 1 commit into from
Jan 18, 2021

Conversation

Cheesebaron
Copy link
Contributor

If someone calls StartScanning before the OnCreateView lifecycle methodis finished doing its thing setting up the Surface etc. Then the callback they pass in StartScanning, never gets triggered.

This fixes this issue, by assuming that in case of someone calling StartScanning before OnCreateView, then scanCallback is set. In such case just call StartScanning again to acutally start scanning and the Scan() method is invoked and everyone is happy.

I don't believe this is a breaking change. Since StartScanning will only get triggered in OnCreateView if the dev already tried calling it prematurely.

Fixes #934

If someone calls StartScanning before the OnCreateView lifecycle method
is finished doing its thing setting up the Surface etc. Then the callback
they pass in StartScanning, never gets triggered.

This fixes the issue, by assuming that in case of someone calling StartScanning
before OnCreateView, then `scanCallback` is set. In such case just call
StartScanning again to acutally start scanning and the Scan() method is invoked.
@Redth Redth merged commit fd87540 into Redth:master Jan 18, 2021
@Cheesebaron Cheesebaron deleted the bugfix/gh934-handler-not-called branch January 19, 2021 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Barcode Found" but result handler not called
2 participants