invalidate the options menu at every viewpager refreshing

This commit is contained in:
tibbi 2018-11-07 22:52:28 +01:00
parent d387820ad2
commit 27c815ec3f
1 changed files with 1 additions and 3 deletions

View File

@ -250,6 +250,7 @@ class MainActivity : SimpleActivity() {
private fun initViewPager() {
NotesHelper(this).getNotes {
mNotes = it
invalidateOptionsMenu()
mCurrentNote = mNotes[0]
mAdapter = NotesPagerAdapter(supportFragmentManager, mNotes, this)
view_pager.apply {
@ -307,7 +308,6 @@ class MainActivity : SimpleActivity() {
NotesHelper(this).insertOrUpdateNote(note) {
val newNoteId = it
showSaveButton = false
invalidateOptionsMenu()
initViewPager()
updateSelectedNote(newNoteId)
view_pager.onGlobalLayout {
@ -407,7 +407,6 @@ class MainActivity : SimpleActivity() {
NotesHelper(this).getNotes {
mNotes = it
showSaveButton = false
invalidateOptionsMenu()
initViewPager()
}
}
@ -590,7 +589,6 @@ class MainActivity : SimpleActivity() {
updateWidgets()
}
invalidateOptionsMenu()
initViewPager()
if (deleteFile) {