Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.houxg.leamonax.database;


import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

import com.raizlabs.android.dbflow.config.FlowManager;
import com.raizlabs.android.dbflow.sql.language.Join;
Expand Down Expand Up @@ -40,8 +42,10 @@ public static List<Note> searchByTitle(String keyword) {
public static void updateFTSNoteByLocalId(Long localId) {
Note note = getByLocalId(localId);
DatabaseWrapper databaseWrapper = FlowManager.getWritableDatabase(AppDataBase.class);
String query = "UPDATE fts_note SET content = '" + note.getContent() + "' where rowid = " + localId;
databaseWrapper.execSQL(query);
ContentValues args = new ContentValues();
args.put("content", note.getContent());
// String query = "UPDATE fts_note SET content = '" + note.getContent() + "' where rowid = " + localId;
databaseWrapper.updateWithOnConflict("fts_note", args, "rowid = " + localId, null, SQLiteDatabase.CONFLICT_REPLACE);
}

public static boolean isExistsTableFTSNote() {
Expand Down