这是方法:
public ArrayList<Integer> getDays() {
Cursor c = database.rawQuery("SELECT * FROM debt;", null);
nameList = new ArrayList<String>();
dayList = new ArrayList<Integer>();
String indName[] = new String[c.getCount()];
String indDay[] = new String[c.getCount()];
int d = 0, j = 0, u = 0;
for (c.moveToFirst(); !c.isAfterLast(); c.moveToNext()) {
indName[j++] = c.getString(c.getColumnIndex("debt_name"));
indDay[d++] = c.getString(c.getColumnIndex("pay_day")); // line 384
}
for (String name : indName) {
if ((indDay[u] != "") || (indDay[u] != null)) {
dayList.add(Integer.valueOf(indDay[u++]));
}
}
c.close();
return dayList;
}
我在第 384 行收到一条错误消息:“无法读取第 0 行,列 -1。确保游标已初始化。”
第 384 行标记在上面。你能找到我在这里想念的东西吗?