Instrumentation test for Android - How to receive new Activity after orientation change?

后端 未结 5 804
臣服心动
臣服心动 2021-01-06 04:11


I\'m trying to test, if newly created Activity (after orientation change) is properly reinitialized. The code below shows that activity returned from getActivity() is t

5条回答
  •  抹茶落季
    2021-01-06 04:44

    Instead of

     MyActivity newActivity = getActivity(); //should be new, but it's not
    

    Try

    MyActivity newActivity = instrumentation.startActivitySync(intent);
    

    I think this method maybe help you

提交回复
热议问题