private String getSelectedConnectTypeKey() {
int re_way = Settings.System.getInt(getContentResolver(),"auto_recorder",0);
switch(re_way){
case 0:
return "null";
case 1:
return "all";
case 2:
return "part";
default:
return "invalidate";
}
}
如上函数,使用反射进行单元测试报错:
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.ContentResolver android.content.Context.getContentResolver()
求教怎莫办?