Skip to content

Instantly share code, notes, and snippets.

@brainail
Last active May 10, 2018
Embed
What would you like to do?
internal class HardWorker : Worker() {
override fun doWork(): Worker.WorkerResult {
reallyMassiveHeavyLongPLayingWork();
return Worker.WorkerResult.SUCCESS // or FAILURE, or RETRY if you want to run again
}
}
fun hardWorkerRunner() {
val hardWork = OneTimeWorkRequest.Builder(HardWorker::class.java).build()
WorkManager.getInstance().enqueue(hardWork)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment