mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08: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;
|
package com.google.zxing.client.android.history;
|
||||||
|
|
||||||
|
import android.database.sqlite.SQLiteException;
|
||||||
import com.google.zxing.BarcodeFormat;
|
import com.google.zxing.BarcodeFormat;
|
||||||
import com.google.zxing.Result;
|
import com.google.zxing.Result;
|
||||||
import com.google.zxing.client.android.Intents;
|
import com.google.zxing.client.android.Intents;
|
||||||
|
@ -237,6 +238,12 @@ public final class HistoryManager {
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
db.delete(DBHelper.TABLE_NAME, DBHelper.ID_COL + '=' + cursor.getString(0), null);
|
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 {
|
} finally {
|
||||||
close(cursor, db);
|
close(cursor, db);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue