Skip to content

Commit 27c815e

Browse files
committed
invalidate the options menu at every viewpager refreshing
1 parent d387820 commit 27c815e

File tree

1 file changed

+1
-3
lines changed
  • app/src/main/kotlin/com/simplemobiletools/notes/pro/activities

1 file changed

+1
-3
lines changed

app/src/main/kotlin/com/simplemobiletools/notes/pro/activities/MainActivity.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ class MainActivity : SimpleActivity() {
250250
private fun initViewPager() {
251251
NotesHelper(this).getNotes {
252252
mNotes = it
253+
invalidateOptionsMenu()
253254
mCurrentNote = mNotes[0]
254255
mAdapter = NotesPagerAdapter(supportFragmentManager, mNotes, this)
255256
view_pager.apply {
@@ -307,7 +308,6 @@ class MainActivity : SimpleActivity() {
307308
NotesHelper(this).insertOrUpdateNote(note) {
308309
val newNoteId = it
309310
showSaveButton = false
310-
invalidateOptionsMenu()
311311
initViewPager()
312312
updateSelectedNote(newNoteId)
313313
view_pager.onGlobalLayout {
@@ -407,7 +407,6 @@ class MainActivity : SimpleActivity() {
407407
NotesHelper(this).getNotes {
408408
mNotes = it
409409
showSaveButton = false
410-
invalidateOptionsMenu()
411410
initViewPager()
412411
}
413412
}
@@ -590,7 +589,6 @@ class MainActivity : SimpleActivity() {
590589
updateWidgets()
591590
}
592591

593-
invalidateOptionsMenu()
594592
initViewPager()
595593

596594
if (deleteFile) {

0 commit comments

Comments
 (0)