android – 从单元测试调用getSharedPreferences()时,UnsupportedOperationException异常
我实现了内容提供者,它从网络上安装的服务中检索数据. 内容提供者从共享首选项(用户凭据,应用程序名称等)获取所需参数 SharedPreferences settings = getContext().getSharedPreferences(NET_PREFS, 0); 我为此内容提供商使用单元测试 public class ResearchProviderTest extends Provid