@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); }