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:
parent
6aed471f31
commit
f228dc4a98
1 changed files with 5 additions and 1 deletions
|
@ -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(
|
||||||
|
|
Loading…
Reference in a new issue