Skip to content
This repository has been archived by the owner on Sep 4, 2019. It is now read-only.

Commit

Permalink
Work around strange SQLiteException on startup; first see if it is tr…
Browse files Browse the repository at this point in the history
…ansient, so swallowing it 'fixes' it?

git-svn-id: http://zxing.googlecode.com/svn/trunk@2168 59b500cc-1b3d-0410-9834-0bbf25fbcc57
  • Loading branch information
srowen committed Feb 6, 2012
1 parent 0cc27d3 commit a8cd1d0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -237,6 +238,12 @@ public void trimHistory() {
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);
}
Expand Down

0 comments on commit a8cd1d0

Please sign in to comment.