Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#inhmethods)

# BroadcastReceiver.PendingResult

*** ** * ** ***

` public static class BroadcastReceiver.PendingResult `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.content.BroadcastReceiver.PendingResult |

<br />

*** ** * ** ***

State for a result that is pending for a broadcast receiver. Returned by `https://developer.android.com/reference/android/content/BroadcastReceiver#goAsync()` while in `https://developer.android.com/reference/android/content/BroadcastReceiver#onReceive(android.content.Context,%20android.content.Intent)`. This allows you to return from onReceive() without having the broadcast terminate; you must call `https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#finish()` once you are done with the broadcast. This allows you to process the broadcast off of the main thread of your app.

Note on threading: the state inside of this class is not itself thread-safe. However, you can use it from any thread if you make sure that you do not have races. Typically this means you will hand the entire object to another thread, which will be solely responsible for setting any results and finally calling `https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#finish()`.

## Summary

| ### Public methods ||
|---|---|
| ` final void` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#abortBroadcast()() ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#abortBroadcast()` for asynchronous broadcast handling. |
| ` final void` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#clearAbortBroadcast()() ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#clearAbortBroadcast()` for asynchronous broadcast handling. |
| ` final void` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#finish()() ` Finish the broadcast. |
| ` final boolean` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#getAbortBroadcast()() ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getAbortBroadcast()` for asynchronous broadcast handling. |
| ` final int` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#getResultCode()() ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getResultCode()` for asynchronous broadcast handling. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#getResultData()() ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getResultData()` for asynchronous broadcast handling. |
| ` final https://developer.android.com/reference/android/os/Bundle` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#getResultExtras(boolean)(boolean makeMap) ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getResultExtras(boolean)` for asynchronous broadcast handling. |
| ` final void` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#setResult(int,%20java.lang.String,%20android.os.Bundle)(int code, https://developer.android.com/reference/java/lang/String data, https://developer.android.com/reference/android/os/Bundle extras) ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResult(int,%20java.lang.String,%20android.os.Bundle)` for asynchronous broadcast handling. |
| ` final void` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#setResultCode(int)(int code) ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResultCode(int)` for asynchronous broadcast handling. |
| ` final void` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#setResultData(java.lang.String)(https://developer.android.com/reference/java/lang/String data) ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResultData(java.lang.String)` for asynchronous broadcast handling. |
| ` final void` | ` https://developer.android.com/reference/android/content/BroadcastReceiver.PendingResult#setResultExtras(android.os.Bundle)(https://developer.android.com/reference/android/os/Bundle extras) ` Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResultExtras(android.os.Bundle)` for asynchronous broadcast handling. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### abortBroadcast

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void abortBroadcast ()
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#abortBroadcast()` for asynchronous broadcast handling.

<br />

### clearAbortBroadcast

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void clearAbortBroadcast ()
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#clearAbortBroadcast()` for asynchronous broadcast handling.

<br />

### finish

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void finish ()
```

Finish the broadcast. The current result will be sent and the next broadcast will proceed.

<br />

### getAbortBroadcast

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final boolean getAbortBroadcast ()
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getAbortBroadcast()` for asynchronous broadcast handling.

<br />

| Returns ||
|---|---|
| `boolean` | <br /> |

### getResultCode

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final int getResultCode ()
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getResultCode()` for asynchronous broadcast handling.

<br />

| Returns ||
|---|---|
| `int` | <br /> |

### getResultData

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final String getResultData ()
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getResultData()` for asynchronous broadcast handling.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | <br /> |

### getResultExtras

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final Bundle getResultExtras (boolean makeMap)
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#getResultExtras(boolean)` for asynchronous broadcast handling.

<br />

| Parameters ||
|---|---|
| `makeMap` | `boolean` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/os/Bundle` | <br /> |

### setResult

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void setResult (int code, 
                String data, 
                Bundle extras)
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResult(int,%20java.lang.String,%20android.os.Bundle)` for asynchronous broadcast handling.

<br />

| Parameters ||
|---|---|
| `code` | `int` <br /> |
| `data` | `String` <br /> |
| `extras` | `Bundle` <br /> |

### setResultCode

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void setResultCode (int code)
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResultCode(int)` for asynchronous broadcast handling.

<br />

| Parameters ||
|---|---|
| `code` | `int` <br /> |

### setResultData

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void setResultData (String data)
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResultData(java.lang.String)` for asynchronous broadcast handling.

<br />

| Parameters ||
|---|---|
| `data` | `String` <br /> |

### setResultExtras

Added in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public final void setResultExtras (Bundle extras)
```

Version of `https://developer.android.com/reference/android/content/BroadcastReceiver#setResultExtras(android.os.Bundle)` for asynchronous broadcast handling.

<br />

| Parameters ||
|---|---|
| `extras` | `Bundle` <br /> |