开发者

At what point in the Activity Lifecycle does an ActivityMonitor fire?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜