Android.Content.Context.RegisterReceiver Method
Register to receive intent broadcasts, to run in the context of scheduler.

Syntax

[Android.Runtime.Register("registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;", "GetRegisterReceiver_Landroid_content_BroadcastReceiver_Landroid_content_IntentFilter_Ljava_lang_String_Landroid_os_Handler_Handler")]
public abstract Intent RegisterReceiver (BroadcastReceiver receiver, IntentFilter filter, string broadcastPermission, Android.OS.Handler scheduler)

See Also

Context.RegisterReceiver(BroadcastReceiver, Android.Content.IntentFilter)
Context.SendBroadcast(Intent)
Context.UnregisterReceiver(BroadcastReceiver)

Parameters

receiver
The BroadcastReceiver to handle the broadcast.
filter
Selects the Intent broadcasts to be received.
broadcastPermission
String naming a permissions that a broadcaster must hold in order to send an Intent to you. If null, no permission is required.
scheduler
Handler identifying the thread that will receive the Intent. If null, the main thread of the process will be used.

Returns

Documentation for this section has not yet been entered.

Remarks

Register to receive intent broadcasts, to run in the context of scheduler. See Context.RegisterReceiver(BroadcastReceiver, Android.Content.IntentFilter) for more information. This allows you to enforce permissions on who can broadcast intents to your receiver, or have the receiver run in a different thread than the main application thread.

See Android.Content.BroadcastReceiver for more information on Intent broadcasts.

As of NoType:android/os/Build$VERSION_CODES;Href=../../../reference/android/os/Build.VERSION_CODES.html#ICE_CREAM_SANDWICH, receivers registered with this method will correctly respect the Intent.SetPackage(string) specified for an Intent being broadcast. Prior to that, it would be ignored and delivered to all matching registered receivers. Be careful if using this for security.

[Android Documentation]

Requirements

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