Context.RegisterReceiver Method

Definition

Overloads

RegisterReceiver(BroadcastReceiver, IntentFilter)

Register a BroadcastReceiver to be run in the main activity thread.

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags)
RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler)

Register to receive intent broadcasts, to run in the context of scheduler.

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags)

RegisterReceiver(BroadcastReceiver, IntentFilter)

Register a BroadcastReceiver to be run in the main activity thread.

[Android.Runtime.Register("registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;", "GetRegisterReceiver_Landroid_content_BroadcastReceiver_Landroid_content_IntentFilter_Handler")]
public abstract Android.Content.Intent RegisterReceiver (Android.Content.BroadcastReceiver receiver, Android.Content.IntentFilter filter);
abstract member RegisterReceiver : Android.Content.BroadcastReceiver * Android.Content.IntentFilter -> Android.Content.Intent

Parameters

receiver
BroadcastReceiver

The BroadcastReceiver to handle the broadcast.

filter
IntentFilter

Selects the Intent broadcasts to be received.

Returns

Intent
Attributes

Remarks

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.

See also

Applies to

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags)

[Android.Runtime.Register("registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;I)Landroid/content/Intent;", "GetRegisterReceiver_Landroid_content_BroadcastReceiver_Landroid_content_IntentFilter_IHandler", ApiSince=26)]
public abstract Android.Content.Intent RegisterReceiver (Android.Content.BroadcastReceiver receiver, Android.Content.IntentFilter filter, Android.Content.ActivityFlags flags);
abstract member RegisterReceiver : Android.Content.BroadcastReceiver * Android.Content.IntentFilter * Android.Content.ActivityFlags -> Android.Content.Intent

Parameters

filter
IntentFilter

Returns

Intent
Attributes

Remarks

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

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler)

Register to receive intent broadcasts, to run in the context of scheduler.

[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 Android.Content.Intent RegisterReceiver (Android.Content.BroadcastReceiver receiver, Android.Content.IntentFilter filter, string broadcastPermission, Android.OS.Handler scheduler);
abstract member RegisterReceiver : Android.Content.BroadcastReceiver * Android.Content.IntentFilter * string * Android.OS.Handler -> Android.Content.Intent

Parameters

receiver
BroadcastReceiver

The BroadcastReceiver to handle the broadcast.

filter
IntentFilter

Selects the Intent broadcasts to be received.

broadcastPermission
String

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

Handler identifying the thread that will receive the Intent. If null, the main thread of the process will be used.

Returns

Intent
Attributes

Remarks

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.

See also

Applies to

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags)

[Android.Runtime.Register("registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;I)Landroid/content/Intent;", "GetRegisterReceiver_Landroid_content_BroadcastReceiver_Landroid_content_IntentFilter_Ljava_lang_String_Landroid_os_Handler_IHandler", ApiSince=26)]
public abstract Android.Content.Intent RegisterReceiver (Android.Content.BroadcastReceiver receiver, Android.Content.IntentFilter filter, string broadcastPermission, Android.OS.Handler scheduler, Android.Content.ActivityFlags flags);
abstract member RegisterReceiver : Android.Content.BroadcastReceiver * Android.Content.IntentFilter * string * Android.OS.Handler * Android.Content.ActivityFlags -> Android.Content.Intent

Parameters

filter
IntentFilter
broadcastPermission
String
scheduler
Handler

Returns

Intent
Attributes

Remarks

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