List of questions
Related questions
Question 3 - Associate Android Developer discussion
Select correct demonstration of WorkRequest cancellation.
A.
workManager.enqueue(OneTimeWorkRequest.Builder(FooWorker::class.java).build())
B.
val request: WorkRequest = OneTimeWorkRequest.Builder(FooWorker::class.java).build() workManager.enqueue(request)val status = workManager.getWorkInfoByIdLiveData(request.id) status.observe(...)
C.
val request: WorkRequest = OneTimeWorkRequest.Builder(FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWorkById(request.id)
D.
val request1: WorkRequest = OneTimeWorkRequest.Builder(FooWorker::class.java).build() val request2: WorkRequest = OneTimeWorkRequest.Builder(BarWorker::class.java).build() val request3: WorkRequest = OneTimeWorkRequest.Builder(BazWorker::class.java).build() workManager.beginWith(request1, request2).then(request3).enqueue()
E.
val request: WorkRequest = OneTimeWorkRequest.Builder(FooWorker::class.java).build() workManager.enqueue(request) workManager.cancelWork(request)
Your answer:
0 comments
Sorted by
Leave a comment first