vendredi 13 mars 2015

IllegalStateExceptionget field slot from row 0 col 0 failed even though moveToFirst() was true

This is the relevant piece of code:



77: Cursor lastDateCursor = db.query(tableName, new String[] {
78: "MAX(start)"
79: }, null, null, null, null, null);
80: if (lastDateCursor != null && lastDateCursor.moveToFirst()) {
81: lastDate = UtilsApp.convertDateToEpoch(lastDateCursor.getString(0), mContext);
.....


And I get the following exception:



IllegalStateExceptionget field slot from row 0 col 0 failed on line 81.



Can anyone explain why line 81 was reached, if the query didn't return any results (i.e. why was moveToFirst() true)? Or could there be an alternative explanation for the exception?


Aucun commentaire:

Enregistrer un commentaire