if a note cannot be loaded, still load the other ones

This commit is contained in:
tibbi 2017-03-07 19:51:55 +01:00
parent 8d7a6c0c36
commit 4e845db003

View File

@ -90,12 +90,16 @@ class DBHelper private constructor(private val mContext: Context) : SQLiteOpenHe
cursor = mDb.query(TABLE_NAME, cols, null, null, null, null, "$COL_TITLE COLLATE NOCASE ASC")
if (cursor?.moveToFirst() == true) {
do {
try {
val id = cursor.getIntValue(COL_ID)
val title = cursor.getStringValue(COL_TITLE)
val value = cursor.getStringValue(COL_VALUE)
val type = cursor.getIntValue(COL_TYPE)
val note = Note(id, title, value, type)
notes.add(note)
} catch (e: Exception) {
continue
}
} while (cursor.moveToNext())
}
} finally {