mirror of
https://github.com/SimpleMobileTools/Simple-Notes.git
synced 2025-03-23 20:10:07 +01:00
changing some code to avoid ConcurrentModificationExceptions
This commit is contained in:
parent
981c19850b
commit
7e7234d0bc
@ -191,20 +191,19 @@ class ChecklistFragment : NoteFragment(), ChecklistItemsListener {
|
||||
return
|
||||
}
|
||||
|
||||
ensureBackgroundThread {
|
||||
context?.let { ctx ->
|
||||
note?.let { currentNote ->
|
||||
if (refreshIndex != -1) {
|
||||
view.checklist_list.post {
|
||||
view.checklist_list.adapter?.notifyItemChanged(refreshIndex)
|
||||
}
|
||||
}
|
||||
|
||||
currentNote.value = getChecklistItems()
|
||||
saveNoteValue(note!!, currentNote.value)
|
||||
ctx.updateWidgets()
|
||||
if (note != null) {
|
||||
if (refreshIndex != -1) {
|
||||
view.checklist_list.post {
|
||||
view.checklist_list.adapter?.notifyItemChanged(refreshIndex)
|
||||
}
|
||||
}
|
||||
|
||||
note!!.value = getChecklistItems()
|
||||
|
||||
ensureBackgroundThread {
|
||||
saveNoteValue(note!!, note!!.value)
|
||||
context?.updateWidgets()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user