Skip to content

Fixed issue when scan job could restart every time when we have activity navigation #1195

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

Conversation

VolodaUa
Copy link
Contributor

The fix fixes the issue when we have the scan job restarting every time during navigation (activity opening) in the app.

Background mode - is set only if the user puts the app in the background or it keeps the background when startMonitoring was called in Application.onCreate during app start(as designed for background scanning).
Foreground mode - is set only one time when app become foreground. Fixed also an issue when starting activity is like the facade to find the proper starting activity to proceed app starting.

Fixes: #1194

@VolodaUa
Copy link
Contributor Author

@davidgyoung Please take a look

Thanks a lot!

@VolodaUa
Copy link
Contributor Author

VolodaUa commented Jun 3, 2024

I am thinking about using ProcessLifecycleOwner.get().getLifecycle() as it's more accurate than activities..

@VolodaUa VolodaUa force-pushed the bugfix/repeadly-scan-job-restart-on-navigation branch from 2a1c98b to 072437e Compare June 3, 2024 09:14
…er activity opened, but old one was stopped

- use ProcessLifecycleOwner callbacks to detect if the app is foreground or background
@VolodaUa VolodaUa force-pushed the bugfix/repeadly-scan-job-restart-on-navigation branch from 072437e to e0975f1 Compare June 3, 2024 09:16
@VolodaUa
Copy link
Contributor Author

Hi @davidgyoung

Could you please prepare a beta version with this fix? I locally tested it a lot and it works.

@VolodaUa
Copy link
Contributor Author

VolodaUa commented Nov 7, 2024

Hi @davidgyoung

We tested this solution with QA for a while. The application faced this issue once we started using this library. The fix solved the problem and then the app worked well. No more complains. I had to use reflection to replace the affected class in the library with my own. It's not good, but it the solution for now.
The application can't detect beacons after simple navigation.

Please let me know if I need to provide more information.

@davidgyoung davidgyoung merged commit 6c0aa93 into AltBeacon:master Nov 16, 2024
@davidgyoung
Copy link
Member

Thank you @VolodaUa

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.

ScanJob restarts scanning every time on navigation
2 participants