如何更新光标数据? cursorComp.requery() - 引发错误
代码:
void someTask() {
try
{
JSONArray jArray = new JSONArray(result);
for(int i=0;i<jArray.length();i++)
{
JSONObject json_data = jArray.getJSONObject(i);
extId = json_data.getString("id");
nameComp = json_data.getString("name");
db.addRec(nameComp,extId,compDescription,minPrice);
//update cursor
cursorComp.requery(); //This line generates an error
}
}
}