Providing test data for SharedPreferences for Robolectric

后端 未结 4 1043
醉梦人生
醉梦人生 2020-12-13 08:40

Just started to use Robolectric and it seems to be pretty much what I need. However, I\'ve hit a bit of a roadblock with regards to the use of SharedPreferences.

I h

4条回答
  •  旧巷少年郎
    2020-12-13 09:19

    robolectric:4.0.2 use val context = ApplicationProvider.getApplicationContext() PreferenceManager.getDefaultSharedPreferences(context)

提交回复
热议问题