전에 문제를 해결하기 위해 주변을 둘러 보았으므로 직접 해결할 수 없으므로 사용자에게 전달됩니다.SQLIte 커서가 비활성화되거나 닫히지 않은 null에서 완료 예외적 인 경우
인한 문제
내 커서 캐치되지 않는 예외 문제가 내가 그것을 밖으로 작동하지 않을 수 있습니다 ....
ERROR 자사의 불평
09-04 15:48:38.863: I/dalvikvm(1421): Uncaught exception thrown by finalizer (will be discarded):
09-04 15:48:38.863: I/dalvikvm(1421): Ljava/lang/IllegalStateException;: Finalizing cursor [email protected] on null that has not been deactivated or closed
09-04 15:48:38.863: I/dalvikvm(1421): at android.database.sqlite.SQLiteCursor.finalize(SQLiteCursor.java:596)
09-04 15:48:38.873: I/dalvikvm(1421): at dalvik.system.NativeStart.run(Native Method)
코드를 회사 소개
public CCTrackLocation getTrackLocationForID(int id) {
CCTrackLocation trackLocation = new CCTrackLocation();
String selectQuery = "SELECT * FROM "+TABLE_TRACK_LOCATION+" WHERE \"id\" = "+ String.valueOf(id);
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery,null);
if (cursor.moveToFirst()) {
do {
trackLocation.setID(cursor.getInt(0));
trackLocation.segmentID = cursor.getInt(1);
trackLocation.timestamp = cursor.getDouble(2);
trackLocation.latitude = cursor.getDouble(3);
trackLocation.longitude = cursor.getDouble(4);
trackLocation.altitude = cursor.getDouble(5);
trackLocation.velocity = cursor.getDouble(6);
trackLocation.heading = cursor.getDouble(7);
trackLocation.haccuracy = cursor.getDouble(8);
trackLocation.vaccuracy = cursor.getDouble(9);
}while(cursor.moveToNext());
}
cursor.close();
db.close();
return trackLocation;
}
도움을 주시면 대단히 감사하겠습니다.