From 6deaae3ac6126b145294a1a0b1ef2c93e0bd3e05 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 24 Oct 2016 23:38:14 +0200 Subject: [PATCH] update the widgets note if the current one is deleted --- .../com/simplemobiletools/notes/activities/MainActivity.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/simplemobiletools/notes/activities/MainActivity.java b/app/src/main/java/com/simplemobiletools/notes/activities/MainActivity.java index 54129c30..42bd1ae3 100644 --- a/app/src/main/java/com/simplemobiletools/notes/activities/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/notes/activities/MainActivity.java @@ -182,7 +182,10 @@ public class MainActivity extends SimpleActivity implements OpenNoteDialog.OpenN mDb.deleteNote(mCurrentNote.getId()); mNotes = mDb.getNotes(); - updateSelectedNote(mNotes.get(0).getId()); + + final int firstNoteId = mNotes.get(0).getId(); + updateSelectedNote(firstNoteId); + mConfig.setWidgetNoteId(firstNoteId); invalidateOptionsMenu(); }