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>
This commit is contained in:
Harsh Shandilya 2020-03-29 15:19:44 +05:30 committed by GitHub
parent 6aed471f31
commit f228dc4a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 { override fun onPrepareOptionsMenu(menu: Menu): Boolean {
// Inflate the menu; this adds items to the action bar if it is present. // 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) searchItem = menu.findItem(R.id.action_search)
searchView = searchItem.actionView as SearchView searchView = searchItem.actionView as SearchView
searchView.setOnQueryTextListener( searchView.setOnQueryTextListener(