List of questions
Related questions
Question 65 - Associate Android Developer discussion
"workManager" is an instance of WorkManager. Select correct demonstration of WorkRequest cancellation:
A.
workManager.enqueue(new OneTimeWorkRequest.Builder(FooWorker.class).build());
B.
WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build(); workManager.enqueue(request);LiveData<WorkInfo> status = workManager.getWorkInfoByIdLiveData(request.getId()); status.observe(...);
C.
WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build(); workManager.enqueue(request);workManager.cancelWorkById(request.getId());
D.
WorkRequest request1 = new OneTimeWorkRequest.Builder(FooWorker.class).build();WorkRequest request2 = new OneTimeWorkRequest.Builder(BarWorker.class).build(); WorkRequest request3 = new OneTimeWorkRequest.Builder(BazWorker.class).build(); workManager.beginWith(request1, request2).then(request3).enqueue();
E.
WorkRequest request = new OneTimeWorkRequest.Builder(FooWorker.class).build(); workManager.enqueue(request); workManager.cancelWork(request);
Your answer:
0 comments
Sorted by
Leave a comment first