I have to implement a periodic request to the server every 15 minutes to update database info, that should be running async while the user is using the app and if the app is closed or paused it shouldn't keep working until the app is resumed
I'm using WorkManager to do that and is already working but I realized that when I minimize my app, the worker keeps calling doWork() every 15 minutes. Killing the app works well because the doWork() is not called.
So the question is how I can disable my worker when app is minimized? Or what I should use instead of WorkManager?