How to stop and restart an activity in an android instrumentation test?

后端 未结 5 553
感情败类
感情败类 2021-02-01 20:43

I\'m trying to write an Android activity instrumentation test that stops (onPause(), then onStop()) and restarts the current activity. I tried

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-01 21:31

    Maybe u could try to save the name of your activity, finish it... and use reflection to get a new instance of the .class for the new intent to create...

提交回复
热议问题