Android - Espresso testing - Close and app and then re-open it?
问题 In my espresso test, I close the app by using "device.pressBack()". I then want to re-open the app, in a certain Activity, but I'm not quite sure how to do that, since I don't even have a context at this point. Does anybody have an idea? 回答1: OK, got it. You define a rule in your test class: @Rule public ActivityTestRule<MyActivity> myActivityTestRule = new ActivityTestRule<>(MyActivity.class, true, false); Then, after you used device.pressback(), you can use this to open that specific