private static final String Memo_Name = "MemoName";
openDB();
String[] col = new String[] {Memo_Name};
Cursor c = db.query(Memo_Table, col, null, null, null, null, null);
String[] result = new String[c.getCount()-1];
if(c.moveToFirst()){
for (int i = 0; i < c.getCount(); i++){
result[i] = c.getString(c.getColumnIndex(Memo_Name));
c.moveToNext();
}//end of for
}
db.close();
此行ArrayIndexOutOfBoundsException
result [i] = c.getString(c.getColumnIndex(Memo_Name));
答案 0 :(得分:2)
删除“-1”