다음을 통해 공유


MockContext.RegisterReceiver Method

Definition

Overloads

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

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

RegisterReceiver(BroadcastReceiver, IntentFilter)

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

RegisterReceiver(BroadcastReceiver, IntentFilter, ActivityFlags)
Obsolete.

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

Caution

This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.

[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)]
[System.Obsolete("This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.")]
public override Android.Content.Intent? RegisterReceiver (Android.Content.BroadcastReceiver? receiver, Android.Content.IntentFilter? filter, string? broadcastPermission, Android.OS.Handler? scheduler, Android.Content.ActivityFlags flags);
[<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)>]
[<System.Obsolete("This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.")>]
override this.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

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 override Android.Content.Intent? RegisterReceiver (Android.Content.BroadcastReceiver? receiver, Android.Content.IntentFilter? filter, string? broadcastPermission, Android.OS.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")>]
override this.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

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)

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 override Android.Content.Intent? RegisterReceiver (Android.Content.BroadcastReceiver? receiver, Android.Content.IntentFilter? filter);
[<Android.Runtime.Register("registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;", "GetRegisterReceiver_Landroid_content_BroadcastReceiver_Landroid_content_IntentFilter_Handler")>]
override this.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

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, ActivityFlags)

Caution

This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.

[Android.Runtime.Register("registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;I)Landroid/content/Intent;", "GetRegisterReceiver_Landroid_content_BroadcastReceiver_Landroid_content_IntentFilter_IHandler", ApiSince=26)]
[System.Obsolete("This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.")]
public override Android.Content.Intent? RegisterReceiver (Android.Content.BroadcastReceiver? receiver, Android.Content.IntentFilter? filter, Android.Content.ActivityFlags flags);
[<Android.Runtime.Register("registerReceiver", "(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;I)Landroid/content/Intent;", "GetRegisterReceiver_Landroid_content_BroadcastReceiver_Landroid_content_IntentFilter_IHandler", ApiSince=26)>]
[<System.Obsolete("This method has an incorrect enumeration type. Use the overload that takes ReceiverFlags instead.")>]
override this.RegisterReceiver : Android.Content.BroadcastReceiver * Android.Content.IntentFilter * Android.Content.ActivityFlags -> Android.Content.Intent

Parameters

filter
IntentFilter

Returns

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