Android Guides | Samples

Android.Content.BroadcastReceiver.PendingResult Class

State for a result that is pending for a broadcast receiver.

See Also: BroadcastReceiver+PendingResult

Syntax

[Android.Runtime.Register("android/content/BroadcastReceiver$PendingResult", DoNotGenerateAcw=true)]
public class BroadcastReceiver.PendingResult : Object

Remarks

State for a result that is pending for a broadcast receiver. Returned by BroadcastReceiver.GoAsync while in BroadcastReceiver.OnReceive(Context,Intent). This allows you to return from onReceive() without having the broadcast terminate; you must call 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 properly 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 BroadcastReceiver+PendingResult.Finish.

[Android Documentation]

Requirements

Namespace: Android.Content
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 11

The members of Android.Content.BroadcastReceiver.PendingResult are listed below.

See Also: Object

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
AbortBroadcastBoolean. Version of BroadcastReceiver.AbortBroadcast for asynchronous broadcast handling.
ResultCodeResult. Version of BroadcastReceiver.ResultCode for asynchronous broadcast handling.
ResultDataString. Version of BroadcastReceiver.ResultData for asynchronous broadcast handling.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

ClearAbortBroadcast()
Version of BroadcastReceiver.ClearAbortBroadcast for asynchronous broadcast handling.
Finish()
Finish the broadcast.
GetResultExtras(Boolean) : Bundle
Version of BroadcastReceiver.GetResultExtras(Boolean) for asynchronous broadcast handling.
InvokeAbortBroadcast()
Version of BroadcastReceiver.InvokeAbortBroadcast for asynchronous broadcast handling.
SetResult(Result, String, Bundle)
Version of BroadcastReceiver.SetResult(Result,String,String) for asynchronous broadcast handling.
SetResultExtras(Bundle)
Version of BroadcastReceiver.SetResultExtras(Bundle) for asynchronous broadcast handling.