update the widgets note if the current one is deleted

This commit is contained in:
tibbi 2016-10-24 23:38:14 +02:00
parent 1870033aab
commit 6deaae3ac6

View File

@ -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();
}