Android Guides | Samples

Android.App.Instrumentation.ActivityMonitor Class

Information about a particular kind of Intent that is being monitored.

See Also: Instrumentation+ActivityMonitor

Syntax

[Android.Runtime.Register("android/app/Instrumentation$ActivityMonitor", DoNotGenerateAcw=true)]
public class Instrumentation.ActivityMonitor : Object

Remarks

Information about a particular kind of Intent that is being monitored. An instance of this class is added to the current instrumentation through Instrumentation.AddMonitor(Instrumentation+ActivityMonitor); after being added, when a new activity is being started the monitor will be checked and, if matching, its hit count updated and (optionally) the call stopped and a canned result returned.

An ActivityMonitor can also be used to look for the creation of an activity, through the Instrumentation+ActivityMonitor.WaitForActivity method. This will return after a matching activity has been created with that activity object.

[Android Documentation]

Requirements

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

The members of Android.App.Instrumentation.ActivityMonitor are listed below.

See Also: Object

Public Constructors

Create a new ActivityMonitor that looks for a particular kind of intent to be started.
Create a new ActivityMonitor that looks for a specific activity class to be started.

Protected Constructors

A constructor used when creating managed representations of JNI objects; called by the runtime.

Public Properties

[read-only]
FilterIntentFilter. Retrieve the filter associated with this ActivityMonitor.
[read-only]
HitsInt32. Retrieve the number of times the monitor has been hit so far.
[read-only]
IsBlockingBoolean. Check whether this monitor blocks activity starts (not allowing the actual activity to run) or allows them to execute normally.
[read-only]
LastActivityActivity. Retrieve the most recent activity class that was seen by this monitor.
[read-only]
ResultInstrumentation+ActivityResult. Retrieve the result associated with this ActivityMonitor, or null if none.

Protected Properties

[read-only]
override
ThresholdClassIntPtr. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.
[read-only]
override
ThresholdTypeType. This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Public Methods

WaitForActivity() : Activity
Block until an Activity is created that matches this monitor, returning the resulting activity.
WaitForActivityWithTimeout(Int64) : Activity
Block until an Activity is created that matches this monitor, returning the resulting activity or till the timeOut period expires.