mirror of
https://github.com/zxing/zxing.git
synced 2024-09-20 13:37:34 -07:00
Work around strange SQLiteException on startup; first see if it is transient, so swallowing it 'fixes' it?
git-svn-id: https://zxing.googlecode.com/svn/trunk@2168 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
2f4d602f42
commit
cae8f40d5c
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.google.zxing.client.android.history;
|
||||
|
||||
import android.database.sqlite.SQLiteException;
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.Result;
|
||||
import com.google.zxing.client.android.Intents;
|
||||
|
@ -237,6 +238,12 @@ public final class HistoryManager {
|
|||
while (cursor.moveToNext()) {
|
||||
db.delete(DBHelper.TABLE_NAME, DBHelper.ID_COL + '=' + cursor.getString(0), null);
|
||||
}
|
||||
} catch (SQLiteException sqle) {
|
||||
// We're seeing an error here when called in CaptureActivity.onCreate() in rare cases
|
||||
// and don't understand it. First theory is that it's transient so can be safely ignored.
|
||||
// TODO revisit this after live in a future version to see if it 'worked'
|
||||
Log.w(TAG, sqle);
|
||||
// continue
|
||||
} finally {
|
||||
close(cursor, db);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue