Sqlite3在很快的时间内更新元素

时间:2014-03-01 11:41:43

标签: android performance sqlite

我正在尝试更新sqlite3数据库中的大量字段,但我仍然不知道是什么问题。我四处搜索,但没有任何问题与我有关。 这是我的代码:

public void highlightSearchListItemsByPositions(List<Integer> results) {
    ContentValues contentValues = new ContentValues();
    contentValues.put(KEY_OPTION_IS_SEARCH_RESULT_ITEM, OPTION_YES);

    db.beginTransaction();

    for (int position : results) {
        db.update(DATABASE_TABLE_LAW, contentValues, KEY_POSITION + " = ?", new String[]{position + ""});
    }

    db.setTransactionSuccessful();
    db.endTransaction();

}

当我通过adb检查时,KEY_OPTION_IS_SEARCH_RESULT_ITEMS列完全用零填充。 OPTION_YES是字符串“1”

0 个答案:

没有答案