Share via


BroadcastReceiver.ResultCode Property

Definition

Retrieve the current result code, as set by the previous receiver. -or- Change the current result code of this broadcast; only works with broadcasts sent through Context#sendOrderedBroadcast(Intent, String) Context.sendOrderedBroadcast.

public Android.App.Result ResultCode { [Android.Runtime.Register("getResultCode", "()I", "")] get; [Android.Runtime.Register("setResultCode", "(I)V", "")] set; }
[<get: Android.Runtime.Register("getResultCode", "()I", "")>]
[<set: Android.Runtime.Register("setResultCode", "(I)V", "")>]
member this.ResultCode : Android.App.Result with get, set

Property Value

int The current result code.

Attributes

Remarks

Property getter documentation:

Retrieve the current result code, as set by the previous receiver.

Java documentation for android.content.BroadcastReceiver.getResultCode().

Property setter documentation:

Change the current result code of this broadcast; only works with broadcasts sent through Context#sendOrderedBroadcast(Intent, String) Context.sendOrderedBroadcast. Often uses the Activity android.app.Activity#RESULT_CANCELED and android.app.Activity#RESULT_OK constants, though the actual meaning of this value is ultimately up to the broadcaster.

<p class="note">This method does not work with non-ordered broadcasts such as those sent with Context#sendBroadcast(Intent) Context.sendBroadcast</p>

Java documentation for android.content.BroadcastReceiver.setResultCode(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • <xref:Android.Content.BroadcastReceiver.SetResult(Android.App.Result%2c+System.String%2c+System.String)>