Skip to content

Commit 962c5cb

Browse files
committed
recheck options menu when a note is added or deleted
1 parent adac7cb commit 962c5cb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/src/main/java/com/simplemobiletools/notes/activities/MainActivity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ protected void onResume() {
5151
super.onResume();
5252
invalidateOptionsMenu();
5353
mNotesView.setTextSize(TypedValue.COMPLEX_UNIT_PX, Utils.getTextSize(getApplicationContext()));
54-
55-
invalidateOptionsMenu();
5654
}
5755

5856
@Override
@@ -143,6 +141,7 @@ public void onClick(View v) {
143141
final int newNoteIndex = getNewNoteIndex(newNote);
144142
updateSelectedNote(newNoteIndex);
145143
alertDialog.dismiss();
144+
invalidateOptionsMenu();
146145
}
147146
}
148147
});
@@ -182,6 +181,7 @@ private void deleteNote() {
182181
mDb.deleteNote(mCurrentNote.getId());
183182
mNotes = mDb.getNotes();
184183
updateSelectedNote(0);
184+
invalidateOptionsMenu();
185185
}
186186

187187
private void displayOpenNoteDialog() {

0 commit comments

Comments
 (0)