# ListenableWorker.Result

Artifact: [androidx.work:work-runtime](https://developer.android.com/jetpack/androidx/releases/work) [View Source](https://cs.android.com/search?q=file:androidx/work/ListenableWorker.java+class:androidx.work.ListenableWorker.Result) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

*** ** * ** ***


```
public abstract class ListenableWorker.Result
```

<br />

*** ** * ** ***

The result of a `https://developer.android.com/reference/androidx/work/ListenableWorker`'s computation. Call `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#success()`, `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#failure()`, or `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#retry()` or one of their variants to generate an object indicating what happened in your background work.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#failure()()` Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed with a permanent failure. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#failure(androidx.work.Data)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/Data outputData)` Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed with a permanent failure. |
| `abstract @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/Data` | `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#getOutputData()()` |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#retry()()` Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work encountered a transient failure and should be retried with backoff specified in `https://developer.android.com/reference/androidx/work/WorkRequest.Builder#setBackoffCriteria(androidx.work.BackoffPolicy,long,java.util.concurrent.TimeUnit)`. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#success()()` Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed successfully. |
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#success(androidx.work.Data)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/Data outputData)` Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed successfully. |

## Public methods

### failure

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
public static @NonNull ListenableWorker.Result failure()
```

Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed with a permanent failure. Any work that depends on this will also be marked as failed and will not be run. **If you need child workers to run, you need to use `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#success()` or `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#success(androidx.work.Data)`**; failure indicates a permanent stoppage of the chain of work.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | An instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` indicating failure when executing work |

### failure

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
public static @NonNull ListenableWorker.Result failure(@NonNull Data outputData)
```

Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed with a permanent failure. Any work that depends on this will also be marked as failed and will not be run. **If you need child workers to run, you need to use `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#success()` or `https://developer.android.com/reference/androidx/work/ListenableWorker.Result#success(androidx.work.Data)`**; failure indicates a permanent stoppage of the chain of work.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/Data outputData` | A `https://developer.android.com/reference/androidx/work/Data` object that can be used to keep track of why the work failed |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | An instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` indicating failure when executing work |

### getOutputData

Added in [2.6.0](https://developer.android.com/jetpack/androidx/releases/work#2.6.0)

```
public abstract @NonNull Data getOutputData()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/Data` | The output `https://developer.android.com/reference/androidx/work/Data` which will be merged into the input `https://developer.android.com/reference/androidx/work/Data` of any `https://developer.android.com/reference/androidx/work/OneTimeWorkRequest` that is dependent on this work request. |

### retry

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
public static @NonNull ListenableWorker.Result retry()
```

Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work encountered a transient failure and should be retried with backoff specified in `https://developer.android.com/reference/androidx/work/WorkRequest.Builder#setBackoffCriteria(androidx.work.BackoffPolicy,long,java.util.concurrent.TimeUnit)`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | An instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` indicating that the work needs to be retried |

### success

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
public static @NonNull ListenableWorker.Result success()
```

Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed successfully. Any work that depends on this can be executed as long as all of its other dependencies and constraints are met.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | An instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` indicating successful execution of work |

### success

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/work#1.0.0)

```
public static @NonNull ListenableWorker.Result success(@NonNull Data outputData)
```

Returns an instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` that can be used to indicate that the work completed successfully. Any work that depends on this can be executed as long as all of its other dependencies and constraints are met.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/Data outputData` | A `https://developer.android.com/reference/androidx/work/Data` object that will be merged into the input Data of any OneTimeWorkRequest that is dependent on this work |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/work/ListenableWorker.Result` | An instance of `https://developer.android.com/reference/androidx/work/ListenableWorker.Result` indicating successful execution of work |