Context.RegisterReceiver Context.RegisterReceiver Method

Definition

Overloads

RegisterReceiver(BroadcastReceiver, IntentFilter) RegisterReceiver(BroadcastReceiver, IntentFilter)

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

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

scheduler

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

RegisterReceiver(BroadcastReceiver, IntentFilter) 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 BroadcastReceiver

The BroadcastReceiver to handle the broadcast.

filter
IntentFilter IntentFilter

Selects the Intent broadcasts to be received.

Returns

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

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags) 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

Returns

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.

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

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 BroadcastReceiver

The BroadcastReceiver to handle the broadcast.

filter
IntentFilter IntentFilter

Selects the Intent broadcasts to be received.

broadcastPermission
String 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

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

Returns

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

RegisterReceiver(BroadcastReceiver, IntentFilter, String, Handler, ActivityFlags) 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

broadcastPermission
String String
scheduler
Handler Handler

Returns

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