title: No activities found. Did you forget to launch the activity by calling getActivity() or startActivitySync or similar
body: <p>When start my android app first start <code>FirstActivity</code>.
  When I click button on <code>FirstActivity</code> than start <code>AddTraderActivity</code>.
  If I press button &quot;<strong>START REQUEST</strong>&quot; in <code>AddTraderActivity</code> then I call:</p>
  <pre><code>setResult(RESULT_OK);
  finish();
  </code></pre>
  <p>As result <code>AddTraderActivity</code> is destroy and show <code>FirstActivity</code>.
  Nice.</p>
  <p>Now I want to write Espresso's tests for <code>AddTraderActivityTest</code> .
  Here tests:</p>
  <pre><code>@RunWith(AndroidJUnit4::class)
  @SmallTest
  class AddTraderActivityTest {
  
      @get:Rule
      var addTraderActivity: IntentsTestRule&lt;AddTraderActivity&gt; =
          IntentsTestRule(AddTraderActivity::class.java)
  
      @Test
      fun toolBarHeight() {
          onView(withId(R.id.toolBar))
              .check(matches(withHeightResId(R.dimen.tool_bar_height)))
      }
  
      @Test
      fun buttonStartTextUppercase() {
          onView(withId(R.id.startButton))
              .check(matches(withTextUppercaseResId(R.string.start)))
      }
  }
  </code></pre>
  <p>As result when I start this tests, then start ONLY <code>AddTraderActivity</code> and tests success pass.
  Nice.</p>
  <p>Now I want to write test for click on button &quot;<strong>START REQUEST</strong>&quot;</p>
  <p>Here test:</p>
  <pre class="lang-kotlin prettyprint-override"><code>@Test
  fun pressButtonStartProgressBarDisplayed() {
      onView(withId(R.id.baseTextInputEditText)).perform(typeText(&quot;BASE_TEST&quot;))
      onView(withId(R.id.quoteTextInputEditText)).perform(typeText(&quot;QUOTE_TEST&quot;))
      onView(withId(R.id.startButton)).perform(click())
  
      onView(withId(R.id.containerProgressBarLayout)).check(matches(isDisplayed()))
  }
  </code></pre>
  <p>As result when test run and press button &quot;<strong>START REQUEST</strong>&quot; I get the next error:</p>
  <p>Testing started at 16:05 ...</p>
  <pre><code>$ adb shell am instrument -w -r   -e debug false -e class 'com.myproject.AddTraderActivityTest#pressButtonStartProgressBarDisplayed' com.myproject.debug.test/androidx.test.runner.AndroidJUnitRunner
  Client not ready yet..
  Started running tests
  
  java.lang.RuntimeException: No activities found. Did you forget to launch the activity by calling getActivity() or startActivitySync or similar?
  at androidx.test.espresso.base.RootViewPicker.waitForAtLeastOneActivityToBeResumed(RootViewPicker.java:169)
  at androidx.test.espresso.base.RootViewPicker.get(RootViewPicker.java:83)
  at androidx.test.espresso.ViewInteractionModule.provideRootView(ViewInteractionModule.java:77)
  at androidx.test.espresso.ViewInteractionModule_ProvideRootViewFactory.provideRootView(ViewInteractionModule_ProvideRootViewFactory.java:35)
  at androidx.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:24)
  at androidx.test.espresso.ViewInteractionModule_ProvideRootViewFactory.get(ViewInteractionModule_ProvideRootViewFactory.java:10)
  at androidx.test.espresso.base.ViewFinderImpl.getView(ViewFinderImpl.java:62)
  at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:276)
  at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:268)
  at java.util.concurrent.FutureTask.run(FutureTask.java:237)
  at android.os.Handler.handleCallback(Handler.java:739)
  at android.os.Handler.dispatchMessage(Handler.java:95)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5417)
  at java.lang.reflect.Method.invoke(Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  </code></pre>
  <p>I get this error because in stack has no activity <code>FirstActivity</code>, because my test not start it.
  So the question is.
  How I can <strong>ISOLATE</strong> test only <code>AddTraderActivity</code>?</p>