Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

Worker

public abstract class Worker
extends NonBlockingWorker

java.lang.Object
   ↳ androidx.work.NonBlockingWorker
     ↳ androidx.work.Worker


The basic object that performs work. Worker classes are instantiated at runtime by WorkManager and the doWork() method is called on a background thread. In case the work is preempted for any reason, the same instance of Worker is not reused. This means that doWork() is called exactly once per Worker instance.

Summary

Nested classes

enum Worker.Result

The result of the Worker's computation that is returned in the Worker.doWork() method. 

Public constructors

Worker()

Public methods

abstract Worker.Result doWork()

Override this method to do your actual background processing.

Inherited methods

Public constructors

Worker

public Worker ()

Public methods

doWork

public abstract Worker.Result doWork ()

Override this method to do your actual background processing.

Returns
Worker.Result