lightbulb_outline Please take our October 2018 developer survey. Start survey

ListenableWorker.Payload

public static final class ListenableWorker.Payload
extends Object

java.lang.Object
   ↳ androidx.work.ListenableWorker.Payload


The payload of an ListenableWorker.onStartWork() computation that contains both the result and the output data.

Summary

Public constructors

ListenableWorker.Payload(ListenableWorker.Result result)

Constructs a Payload with the given ListenableWorker.Result and an empty output.

ListenableWorker.Payload(ListenableWorker.Result result, Data output)

Constructs a Payload with the given ListenableWorker.Result and output.

Public methods

Data getOutputData()
ListenableWorker.Result getResult()

Inherited methods

Public constructors

ListenableWorker.Payload

public ListenableWorker.Payload (ListenableWorker.Result result)

Constructs a Payload with the given ListenableWorker.Result and an empty output.

Parameters
result ListenableWorker.Result: The result of the ListenableWorker.onStartWork() computation

ListenableWorker.Payload

public ListenableWorker.Payload (ListenableWorker.Result result, 
                Data output)

Constructs a Payload with the given ListenableWorker.Result and output.

Parameters
result ListenableWorker.Result: The result of the ListenableWorker.onStartWork() computation

output Data: The output Data of the ListenableWorker.onStartWork() computation

Public methods

getOutputData

public Data getOutputData ()

Returns
Data The output Data of this ListenableWorker