I am going through the Google Codelabs Android basics for Kotlin WorkManager. I've seen the code written one way, then later on see it a different way, and was wondering if there was a difference at all between these?
// Add WorkRequest to save the image to the filesystem
val save = OneTimeWorkRequest.Builder(SaveImageToFileWorker::class.java).build()
// Add WorkRequest to save the image to the filesystem
val save = OneTimeWorkRequestBuilder<SaveImageToFileWorker>()
.build()
Do these do the same thing?
OneTimeWorkRequestBuilder<T>() is just a function that creates and returns an object of type OneTimeWorkRequest.Builder and there are no differences between them.
You can check the OneTimeWorkRequestBuilder function signuature here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With