How can I test fragments with Robolectric?

后端 未结 7 1123
萌比男神i
萌比男神i 2020-12-02 10:16

I know there is a Robolectric.shadowOf(Fragment) method and a ShadowFragment class, thought they aren\'t listed on the docs, but I can\'t make it w

7条回答
  •  一整个雨季
    2020-12-02 11:05

    I'm pretty sure you have to create a FragmentTransaction using the FragmentManager, then it will work.

提交回复
热议问题