Android. Is WorkManager running when app is closed?
问题 I want to schedule nightly database updates. So I use new Android WorkManager. My understanding is that once scheduled it will always run in the background independently from the app's lifecycle. Is that right? My first tests show that Work is only being performed when the app is running. val locationWork = PeriodicWorkRequest.Builder(UpdateDatabaseWorker::class.java, 24, TimeUnit.HOURS) .addTag("DATABASE_UPDATE_SERVICE") .build() WorkManager.getInstance().enqueue(locationWork) 回答1: Based on