From 6aed471f318052e86c9a36c7b1da7e569f16a123 Mon Sep 17 00:00:00 2001 From: Fabian Henneke Date: Sun, 29 Mar 2020 09:35:54 +0200 Subject: Workaround and potential fix for search issues (#677) --- app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt index 7495cff1..2a5343fd 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.kt @@ -159,7 +159,7 @@ class PasswordStore : AppCompatActivity() { } } - override fun onCreateOptionsMenu(menu: Menu): Boolean { + 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) @@ -167,6 +167,7 @@ class PasswordStore : AppCompatActivity() { searchView.setOnQueryTextListener( object : OnQueryTextListener { override fun onQueryTextSubmit(s: String): Boolean { + filterListAdapter(s) searchView.clearFocus() return true } @@ -193,7 +194,7 @@ class PasswordStore : AppCompatActivity() { if (settings.getBoolean("search_on_start", false)) { searchItem.expandActionView() } - return super.onCreateOptionsMenu(menu) + return super.onPrepareOptionsMenu(menu) } // Handle action bar item clicks here. The action bar will -- cgit v1.2.3