public static double getLastModified(String deckPath) { double value; Cursor cursor = null; // Log.i(TAG, "Deck - getLastModified from deck = " + deckPath); AnkiDb.openDatabase(deckPath); try { cursor = AnkiDb.database.rawQuery("SELECT modified" + " FROM decks" + " LIMIT 1", null); if (!cursor.moveToFirst()) value = -1; else value = cursor.getDouble(0); } finally { if (cursor != null) cursor.close(); } AnkiDb.closeDatabase(); return value; }
public void closeDeck() { DeckTask.waitToFinish(); // Wait for any thread working on the deck to finish. if (modifiedSinceSave()) commitToDB(); AnkiDb.closeDatabase(); }