Instrumentation.AddMonitor Method

Definition

Overloads

Name Description
AddMonitor(Instrumentation+ActivityMonitor)

Add a new ActivityMonitor that will be checked whenever an activity is started.

AddMonitor(IntentFilter, Instrumentation+ActivityResult, Boolean)

A convenience wrapper for addMonitor(ActivityMonitor) that creates an intent filter matching ActivityMonitor for you and returns it.

AddMonitor(String, Instrumentation+ActivityResult, Boolean)

A convenience wrapper for addMonitor(ActivityMonitor) that creates a class matching ActivityMonitor for you and returns it.

AddMonitor(Instrumentation+ActivityMonitor)

Add a new ActivityMonitor that will be checked whenever an activity is started.

[Android.Runtime.Register("addMonitor", "(Landroid/app/Instrumentation$ActivityMonitor;)V", "GetAddMonitor_Landroid_app_Instrumentation_ActivityMonitor_Handler")]
public virtual void AddMonitor(Android.App.Instrumentation.ActivityMonitor? monitor);
[<Android.Runtime.Register("addMonitor", "(Landroid/app/Instrumentation$ActivityMonitor;)V", "GetAddMonitor_Landroid_app_Instrumentation_ActivityMonitor_Handler")>]
abstract member AddMonitor : Android.App.Instrumentation.ActivityMonitor -> unit
override this.AddMonitor : Android.App.Instrumentation.ActivityMonitor -> unit

Parameters

monitor
Instrumentation.ActivityMonitor

Instrumentation.ActivityMonitor: The new ActivityMonitor to see.

Attributes

Remarks

Add a new ActivityMonitor that will be checked whenever an activity is started. The monitor is added after any existing ones; the monitor will be hit only if none of the existing monitors can themselves handle the Intent.

See also:

Android reference for android.app.Instrumentation.addMonitor.

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

AddMonitor(IntentFilter, Instrumentation+ActivityResult, Boolean)

A convenience wrapper for addMonitor(ActivityMonitor) that creates an intent filter matching ActivityMonitor for you and returns it.

[Android.Runtime.Register("addMonitor", "(Landroid/content/IntentFilter;Landroid/app/Instrumentation$ActivityResult;Z)Landroid/app/Instrumentation$ActivityMonitor;", "GetAddMonitor_Landroid_content_IntentFilter_Landroid_app_Instrumentation_ActivityResult_ZHandler")]
public virtual Android.App.Instrumentation.ActivityMonitor? AddMonitor(Android.Content.IntentFilter? filter, Android.App.Instrumentation.ActivityResult? result, bool block);
[<Android.Runtime.Register("addMonitor", "(Landroid/content/IntentFilter;Landroid/app/Instrumentation$ActivityResult;Z)Landroid/app/Instrumentation$ActivityMonitor;", "GetAddMonitor_Landroid_content_IntentFilter_Landroid_app_Instrumentation_ActivityResult_ZHandler")>]
abstract member AddMonitor : Android.Content.IntentFilter * Android.App.Instrumentation.ActivityResult * bool -> Android.App.Instrumentation.ActivityMonitor
override this.AddMonitor : Android.Content.IntentFilter * Android.App.Instrumentation.ActivityResult * bool -> Android.App.Instrumentation.ActivityMonitor

Parameters

filter
IntentFilter

IntentFilter: The set of intents this monitor is responsible for.

result
Instrumentation.ActivityResult

Instrumentation.ActivityResult: A canned result to return if the monitor is hit; can be null.

block
Boolean

boolean: Controls whether the monitor should block the activity start (returning its canned result) or let the call proceed.

Returns

The newly created and added activity monitor.

Attributes

Remarks

A convenience wrapper for addMonitor(ActivityMonitor) that creates an intent filter matching ActivityMonitor for you and returns it.

See also:

Android reference for android.app.Instrumentation.addMonitor.

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

AddMonitor(String, Instrumentation+ActivityResult, Boolean)

A convenience wrapper for addMonitor(ActivityMonitor) that creates a class matching ActivityMonitor for you and returns it.

[Android.Runtime.Register("addMonitor", "(Ljava/lang/String;Landroid/app/Instrumentation$ActivityResult;Z)Landroid/app/Instrumentation$ActivityMonitor;", "GetAddMonitor_Ljava_lang_String_Landroid_app_Instrumentation_ActivityResult_ZHandler")]
public virtual Android.App.Instrumentation.ActivityMonitor? AddMonitor(string? cls, Android.App.Instrumentation.ActivityResult? result, bool block);
[<Android.Runtime.Register("addMonitor", "(Ljava/lang/String;Landroid/app/Instrumentation$ActivityResult;Z)Landroid/app/Instrumentation$ActivityMonitor;", "GetAddMonitor_Ljava_lang_String_Landroid_app_Instrumentation_ActivityResult_ZHandler")>]
abstract member AddMonitor : string * Android.App.Instrumentation.ActivityResult * bool -> Android.App.Instrumentation.ActivityMonitor
override this.AddMonitor : string * Android.App.Instrumentation.ActivityResult * bool -> Android.App.Instrumentation.ActivityMonitor

Parameters

cls
String

String: The activity class this monitor is responsible for.

result
Instrumentation.ActivityResult

Instrumentation.ActivityResult: A canned result to return if the monitor is hit; can be null.

block
Boolean

boolean: Controls whether the monitor should block the activity start (returning its canned result) or let the call proceed.

Returns

The newly created and added activity monitor.

Attributes

Remarks

A convenience wrapper for addMonitor(ActivityMonitor) that creates a class matching ActivityMonitor for you and returns it.

See also:

Android reference for android.app.Instrumentation.addMonitor.

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