From f228dc4a9824f39676fab597d0a83db3f018d378 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 29 Mar 2020 15:19:44 +0530 Subject: Don't inflate menu multiple times (#678) Otherwise you get this insanity https://i.imgur.com/N918NFG.png Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/src/main') 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( -- cgit v1.2.3