Last active
May 10, 2018 10:08
-
-
Save brainail/fb7183ae5bb27b228b3df7b762ffbe60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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