The documentation for SingleLaunchActivityTestCase says that this class is now deprecated, and it should be replaced with ActivityScenarioRule or ActivityTestRule. But how is this done?
SingleLaunchActivityTestCase allowed an Activity to launch once and keep it open; then multiple tests can run during this time, then the Activity is closed. ActivityTestRule does not seem to have this functionality - it always relaunches the Activity for each @Test method.
So is it possible to make ActivityTestRule launch an Activity once and keep it open, and how do I ensure the context (from activityTestRule.getActivity()) is not null for each @Test function?
Example code here.