Java 类android.support.test.runner.MonitoringInstrumentation 实例源码

项目:material-activity-chooser    文件:IntentTestRuleWithActivityFactory.java   
@Override
public ACTIVITY launchActivity(@Nullable Intent startIntent) {
    MonitoringInstrumentation instrumentation = ((MonitoringInstrumentation) InstrumentationRegistry.getInstrumentation());
    if (mActivityFactory != null) {
        instrumentation.interceptActivityUsing(mActivityFactory);
    } else {
        instrumentation.useDefaultInterceptingActivityFactory();
    }
    return super.launchActivity(startIntent);
}