How can we access context of an application in Robolectric?

后端 未结 14 1519
既然无缘
既然无缘 2020-12-05 03:32

Actually, I need to get a response of an API call, for that I required Context.

14条回答
  •  清歌不尽
    2020-12-05 04:09

    This works for me with Robolectric 3.5.1: ShadowApplication.getInstance().applicationContext

提交回复
热议问题