mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-22 21:06:09 +03:00
Allow database queries on main thread
This commit is contained in:
parent
d309f5dd6b
commit
c1a12299b4
2 changed files with 3 additions and 2 deletions
|
@ -318,7 +318,8 @@ public abstract class BaseNoteFragment extends BrandedFragment implements Catego
|
|||
Log.v(TAG, "... not saving, since nothing has changed");
|
||||
}
|
||||
} else {
|
||||
new Thread(() -> note = db.updateNoteAndSync(localAccount, note, newContent, null, callback)).start();
|
||||
// FIXME requires database queries on main thread!
|
||||
note = db.updateNoteAndSync(localAccount, note, newContent, null, callback);
|
||||
listener.onNoteUpdated(note);
|
||||
requireActivity().invalidateOptionsMenu();
|
||||
}
|
||||
|
|
|
@ -132,7 +132,7 @@ public abstract class NotesDatabase extends RoomDatabase {
|
|||
Log.v(TAG, NotesDatabase.class.getSimpleName() + " created.");
|
||||
}
|
||||
})
|
||||
// .allowMainThreadQueries() // FIXME remove
|
||||
.allowMainThreadQueries() // FIXME Needed in BaseNoteFragment#saveNote()
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue