diff options
author | Harsh Shandilya <msfjarvis@gmail.com> | 2020-03-29 15:19:44 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-29 15:19:44 +0530 |
commit | f228dc4a9824f39676fab597d0a83db3f018d378 (patch) | |
tree | d2a87414f2e8ed31bd9f841b3233a9bc7e2bb197 /app/src/main/java | |
parent | 6aed471f318052e86c9a36c7b1da7e569f16a123 (diff) |
Don't inflate menu multiple times (#678)
Otherwise you get this insanity https://i.imgur.com/N918NFG.png
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt index 2a5343fd..bd96528f 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt @@ -159,9 +159,13 @@ class PasswordStore : AppCompatActivity() { } } + override fun onCreateOptionsMenu(menu: Menu?): Boolean { + menuInflater.inflate(R.menu.main_menu, menu) + return super.onCreateOptionsMenu(menu) + } + override fun onPrepareOptionsMenu(menu: Menu): Boolean { // Inflate the menu; this adds items to the action bar if it is present. - menuInflater.inflate(R.menu.main_menu, menu) searchItem = menu.findItem(R.id.action_search) searchView = searchItem.actionView as SearchView searchView.setOnQueryTextListener( |