RemoteListenableWorker

public abstract class RemoteListenableWorker
extends ListenableWorker

java.lang.Object
   ↳ androidx.work.ListenableWorker
     ↳ androidx.work.multiprocess.RemoteListenableWorker


Is an implementation of a ListenableWorker that can bind to a remote process.

To be able to bind to a remote process, A RemoteListenableWorker needs additional arguments as part of its input Data.

The arguments (ARGUMENT_PACKAGE_NAME, ARGUMENT_CLASS_NAME) are used to determine the Service that the RemoteListenableWorker can bind to. startRemoteWork() is then subsequently called in the process that the Service is running in.

Summary

Constants

String ARGUMENT_CLASS_NAME

The ARGUMENT_PACKAGE_NAME, className together determine the ComponentName that the RemoteListenableWorker binds to before calling startRemoteWork().

String ARGUMENT_PACKAGE_NAME

The #ARGUMENT_PACKAGE_NAME, ARGUMENT_CLASS_NAME together determine the ComponentName that the RemoteListenableWorker binds to before calling startRemoteWork().

Public constructors

RemoteListenableWorker(Context appContext, WorkerParameters workerParams)

Public methods

void onStopped()

This method is invoked when this Worker has been told to stop.

ListenableFuture<Void> setProgressAsync(Data data)

Updates ListenableWorker progress.

abstract ListenableFuture<ListenableWorker.Result> startRemoteWork()

Override this method to define the work that needs to run in the remote process.

final ListenableFuture<ListenableWorker.Result> startWork()

Override this method to start your actual background processing.

Inherited methods