Lifecycle Testing with Robotium: Killing and Restarting Activity

后端 未结 1 1847
眼角桃花
眼角桃花 2020-12-11 12:04

How is it possible to restart an activity that was ended using Robotium\'s solo.goBack()?

The following does not restart the activity: (

相关标签:
1条回答
  • 2020-12-11 12:28

    As @IHeartAndroid said in his answer to this robotium question (I had not seen it before, there was a link by @Flavio Capaccio in a comment to a "related question"):

    launchActivity("com.testRestart", testactivity.class, null);
    

    works. This is a function in InstrumentationTestCase.

    (If you want to upvote this answer, upvote his answer as well)

    0 讨论(0)
提交回复
热议问题