Skip to content Skip to sidebar Skip to footer

How To Cancel Work From Workmanager In Android?

I have saved the WorkManager UUID converted to String in Realm database. Here is the code - Constraints constraints = new Constraints.Builder().setRequiredNetworkType(NetworkType

Solution 1:

If you're using Worker, you need to override the onStopped() method and use that as the signal for your worker to cancel its ongoing work. Within your doWork() method, you can also use isStopped() to check for cancellation.


Post a Comment for "How To Cancel Work From Workmanager In Android?"