android.app
public
static
class
android.app.Instrumentation.ActivityMonitor
Summary
Public Constructors
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
Create a new ActivityMonitor that looks for a particular kind of
intent to be started.
Parameters
which
| The set of intents this monitor is responsible for. |
result
| A canned result to return if the monitor is hit; can
be null. |
block
| Controls whether the monitor should block the activity
start (returning its canned result) or let the call
proceed. |
Create a new ActivityMonitor that looks for a specific activity
class to be started.
Parameters
cls
| The activity class this monitor is responsible for. |
result
| A canned result to return if the monitor is hit; can
be null. |
block
| Controls whether the monitor should block the activity
start (returning its canned result) or let the call
proceed. |
Public Methods
public
final
IntentFilter
getFilter()
Retrieve the filter associated with this ActivityMonitor.
public
final
int
getHits()
Retrieve the number of times the monitor has been hit so far.
public
final
Activity
getLastActivity()
Retrieve the most recent activity class that was seen by this
monitor.
Retrieve the result associated with this ActivityMonitor, or null if
none.
public
final
boolean
isBlocking()
Check whether this monitor blocks activity starts (not allowing the
actual activity to run) or allows them to execute normally.
public
final
Activity
waitForActivity()
Block until an Activity is created that matches this monitor,
returning the resulting activity.
public
final
Activity
waitForActivityWithTimeout(long timeOut)
Block until an Activity is created that matches this monitor,
returning the resulting activity or till the timeOut period expires.
If the timeOut expires before the activity is started, return null.
Parameters
timeOut
| Time to wait before the activity is created. |