Understanding WorkManager state
In the previous recipe, Understanding the Jetpack WorkManager library, we looked into how we can use WorkManager
. In that recipe, you might have noticed Work
goes through a series of state changes, and the doWork
function returns a result.
In this recipe, we will explore states in depth.
How to do it…
We will continue working on an example of how you can apply the concepts learned about in this recipe to your already-built project:
- You might have noticed we mentioned before that we have three states:
Success
,Failure
, andRetry
.Work
states, however, have different types of processes; we can have a one-time work state, periodic work state, or blocked state:Result
SUCCESS, FAILURE, RETRY
You can look into this abstract class in more depth by clicking on the result and seeing how it is written.
- In the first recipe, Understanding the Jetpack WorkManager library, we looked into the steps of setting...