Understanding chaining and canceling work requests
In Android development, ensuring you properly handle your application’s life cycle is crucial. Needless to say, this also applies to all background work, as a simple mistake can lead to your application draining the user’s battery, memory leaks, or even causing the application to crash or suffer from an application not responding (ANR) error. This could mean terrible reviews in the Play Store, which will later affect your business and causes stress for developers. How do you ensure this issue is handled well?
This can be done by ensuring all conflicts that arise while using WorkManager
are appropriately handled or guaranteeing the policy we touched on in the previous recipe is well coded. In this recipe, we will look into chaining and canceling work requests and how to handle long-running work properly.
Say your project requires an order by which the operation should run; WorkManager
gives you the ability to enqueue...