Reputation:
My android application doesn't run the workmanager when I killed the application. The workmanager stop working when the application process killed.
my code is :
PeriodicWorkRequest workRequest =
new PeriodicWorkRequest.Builder(UploadWorker.class, 1, TimeUnit.MINUTES)
.setConstraints(constraints)
.build();
WorkManager.getInstance().enqueue(workRequest);
and I have also applied Jobscheduler
but the program is working when application still alive in the process. but when the application closed the workmanager is not working. I have set the periodic time is 1 min
.
Upvotes: 2
Views: 4582
Reputation: 1
The workmanager DOES NOT stop working when the application process killed, you set the period to 1 minute and minimum is 15 minute, so workmanager does the work you specified every 15 minute instead of 1 minute and ignore that 1 minute!
Upvotes: 0
Reputation: 841
The minimum interval for PeriodicWork is 15 minutes. Can you change the interval to 15 and check. Please check
https://stackoverflow.com/a/51074388/2131915
Upvotes: 2