あなたが尋ねる前に、私は自分の問題の解決策を探しましたが、自分で解決することはできません。
問題
カーソルでキャッチされない例外の問題があり、解決できません....
エラー
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 android.database.sqlite.SQLiteCursor@44ef6598 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;
}
どんな助けでも大歓迎です。