I have a test that is using an ActivityMonitor to wait for an activity to start, e.g.
// ins is an instance of the Instrumentation class.
Instrumentation.ActivityMonitor mon = new Instrumentation.ActivityMonitor((String)null, null, false);
ins.addMonitor(mon);
// do something that will start an activity
Activity a = ins.waitForMonitorWithTimeout(mon, msWaitTime);
At the point when waitForMonitorWithTimeout returns, what point in the activity lifecycle is the activity at, has it already been through create/start/resume etc, or is that still going on ? The docs just say that it returns the started activity, but with no indication of what st开发者_如何学JAVAate the activity is in.
This doesn't appear to be documented anywhere, but testing shows that the waitForMonitorWithTimeout
call returns very early in the new activities lifecycle, as far as i can tell, just after onCreate returns.
精彩评论