Hello,
Welcome to our Microsoft Q&A platform!
You can try to restarted the service once it been finished by a BroadcastReceiver
.
The function of BroadcastReceiver is to receive a signal when someone or something kills the service; its role is to restart the service.
For more details, you can check:
https://fabcirablog.weebly.com/blog/creating-a-never-ending-background-service-in-android
Though it's Java code, it's easy to understand and convert.
Best Regards,
Jessie Zhang
---
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.