Skip to content Skip to sidebar Skip to footer

How Can I Keep The Job Service Running When The App Is Closed From Recent Task List By User

I am using Job Scheduler API in my app to schedule a job for me after specific time interval. It runs fine when the app is running. But whenever the user closes the app or clears i

Solution 1:

When doing stuff periodically in the background — JobScheduler, WorkManager, AlarmManager, FCM push messages, etc. — you have to take into account that your process might not be around when it is time for you to do your work. Android will fork a process for you, but it is "starting from scratch". Anything that your UI might have set up in memory, such as a database, would have been for some prior process and might not be set up in the new process.


Post a Comment for "How Can I Keep The Job Service Running When The App Is Closed From Recent Task List By User"