嘿,你好,我使用上述代码的时候,出现了: android.database.CursorIndexOutOfBoundsException: Index -1 requested, with a size of 1 异常,解决方法如下:
Cursor mCursor = db.rawQuery(strSql, null);
mCursor.moveToNext();
int maxId = mCursor .getInt(mCursor.getColumnIndex(maxId));
你没有遇到过该异常吗?
另:如有错误,欢迎指出。
Thanks.