ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 85 - Associate Android Developer discussion

Report
Export

When scheduling unique work, you must tell WorkManager what action to take when there is a conflict. You do this by passing an enum when enquing the work.

For one-time work, you provide an ExistingWorkPolicy, which supports some options for handling the conflict. (Choose four.)

A.
REPLACE (existing work with the new work. This option cancels the existing work)
Answers
A.
REPLACE (existing work with the new work. This option cancels the existing work)
B.
KEEP (existing work and ignore the new work)
Answers
B.
KEEP (existing work and ignore the new work)
C.
APPEND (the new work to the end of the existing work. This policy will cause your new work to be chained to the existing work, running after the existing work finishes)
Answers
C.
APPEND (the new work to the end of the existing work. This policy will cause your new work to be chained to the existing work, running after the existing work finishes)
D.
APPEND_OR_REPLACE (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still runs)
Answers
D.
APPEND_OR_REPLACE (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still runs)
E.
APPEND_OR_KEEP (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still not runs)
Answers
E.
APPEND_OR_KEEP (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is CANCELLED or FAILED, the new work still not runs)
F.
APPEND_AND_RUN (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is PAUSED, the new work still runs)
Answers
F.
APPEND_AND_RUN (functions similarly to APPEND, except that it is not dependent on prerequisite work status. If the existing work is PAUSED, the new work still runs)
G.
DESTROY (if any work exists, the new work will be ignored)
Answers
G.
DESTROY (if any work exists, the new work will be ignored)
H.
APPEND_OR_DESTROY (if no any work exists, the new work will be ignored)
Answers
H.
APPEND_OR_DESTROY (if no any work exists, the new work will be ignored)
Suggested answer: A, B, C, D

Explanation:

Videos:

Working with WorkManager, from the 2018 Android Dev Summit

WorkManager: Beyond the basics, from the 2019 Android Dev Summit

Reference: https://developer.android.com/reference/androidx/work/WorkManager?hl=en

asked 18/09/2024
James Sutter
33 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first