{ override fun doWork(): Result { // Do the work here return Result.success() } } val request = OneTimeWorkRequest .Builder(SomeWorker::class.java) .setInitialDelay(1, TimeUnit.HOURS) .build() WorkManager.getInstance() .enqueue(request)
{ override fun doWork(): Result { // Do the work here return Result.success() } } val request = PeriodicWorkRequest .Builder(SomeWorker::class.java, 1, TimeUnit.HOURS) .build() WorkManager.getInstance() .enqueue(request)