Skip to content

Task stays open when app is closed from the running apps list #86

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

Closed
yoavrofe opened this issue Jun 7, 2022 · 3 comments
Closed

Task stays open when app is closed from the running apps list #86

yoavrofe opened this issue Jun 7, 2022 · 3 comments

Comments

@yoavrofe
Copy link

yoavrofe commented Jun 7, 2022

Sometimes the user may try to close the app by swiping it off the running apps list. However, this doesn't close the foreground process. Is there a way to remove the task in this scenario?

@cheeco83
Copy link

cheeco83 commented Jun 13, 2022

@yoavrofe I have experienced the same problem. I tried solving it by using the AppLifecycleState - Observer and stop the service once the app lifecycle is disposed, as described here: https://www.youtube.com/watch?v=DqJ_KjFzL9I On app-closure, the stopService() - function is called as expected, but unfortunately the background task is still not stopped.

I attached here my (so far unsuccessful attempts with lifecycle observer).

A solution would be highly appreciated!

main.zip

@cheeco83
Copy link

cheeco83 commented Jun 14, 2022

@yoavrofe I think the solution is far more simple than expected! Browsing through the issue tracker, I found the following answer from the developers. link

Worked perfectly for me!

@yoavrofe
Copy link
Author

Thanks a lot, @cheeco83 ! It works perfectly for me as well.

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

No branches or pull requests

2 participants