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

Have you considered scenarios for when a ForegroundService crashes? #2

Open
sobvan opened this issue Aug 2, 2018 · 2 comments
Open

Comments

@sobvan
Copy link

sobvan commented Aug 2, 2018

It looks like for the restart you need an Activity in the foreground.
I would like to make my ForegroundService restart if there is an exception.
I will experiment with this anyway, but maybe someone has some suggestions.

@patrickfav
Copy link
Owner

AFAIK you can inject your own behaviour through DI with the provided interfaces. I do not fully understand your use case, but if you have any improvement suggestions Im open/looking forward to a PR :)

@sobvan
Copy link
Author

sobvan commented Aug 7, 2018

To make it more clear. My app uses a ForgroundService to be able to constantly run in the backgorund. It is called ForegroundService because there is an ongoing notification displayed all the time. So most of the time there is no Activity associated with my app. But it might still crash when running without an activity. And I still want it to restart.
I will experiment with it and come back with a PR if there is a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants