|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.app.Instrumentation.ActivityMonitor
public static class Instrumentation.ActivityMonitor
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(android.app.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 waitForActivity() method. This will return
after a matching activity has been created with that activity object.
| Field Summary | |
|---|---|
(package private) int |
mHits
|
(package private) Activity |
mLastActivity
|
| Constructor Summary | |
|---|---|
Instrumentation.ActivityMonitor(IntentFilter which,
Instrumentation.ActivityResult result,
boolean block)
Create a new ActivityMonitor that looks for a particular kind of intent to be started. |
|
Instrumentation.ActivityMonitor(String cls,
Instrumentation.ActivityResult result,
boolean block)
Create a new ActivityMonitor that looks for a specific activity class to be started. |
|
| Method Summary | |
|---|---|
IntentFilter |
getFilter()
Retrieve the filter associated with this ActivityMonitor. |
int |
getHits()
Retrieve the number of times the monitor has been hit so far. |
Activity |
getLastActivity()
Retrieve the most recent activity class that was seen by this monitor. |
Instrumentation.ActivityResult |
getResult()
Retrieve the result associated with this ActivityMonitor, or null if none. |
boolean |
isBlocking()
Check whether this monitor blocks activity starts (not allowing the actual activity to run) or allows them to execute normally. |
(package private) boolean |
match(Context who,
Activity activity,
Intent intent)
|
Activity |
waitForActivity()
Block until an Activity is created that matches this monitor, returning the resulting activity. |
Activity |
waitForActivityWithTimeout(long timeOut)
Block until an Activity is created that matches this monitor, returning the resulting activity or till the timeOut period expires. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int mHits
Activity mLastActivity
| Constructor Detail |
|---|
public Instrumentation.ActivityMonitor(IntentFilter which,
Instrumentation.ActivityResult result,
boolean block)
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.Instrumentation.addMonitor(android.app.Instrumentation.ActivityMonitor)
public Instrumentation.ActivityMonitor(String cls,
Instrumentation.ActivityResult result,
boolean block)
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.Instrumentation.addMonitor(android.app.Instrumentation.ActivityMonitor)| Method Detail |
|---|
public final IntentFilter getFilter()
public final Instrumentation.ActivityResult getResult()
public final boolean isBlocking()
public final int getHits()
public final Activity getLastActivity()
public final Activity waitForActivity()
public final Activity waitForActivityWithTimeout(long timeOut)
timeOut - Time to wait before the activity is created.
final boolean match(Context who,
Activity activity,
Intent intent)
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||