From d9bf4682b6430d4eeb87a5e5c03221e9fe29044c Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 1 Feb 2016 08:36:22 +0100 Subject: [PATCH] Hide keyboard on search submit --- app/src/main/java/eu/faircode/netguard/ActivityMain.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java index acddb39b..4f550011 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java @@ -495,12 +495,13 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences // Search menuSearch = menu.findItem(R.id.menu_search); - SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuSearch); + final SearchView searchView = (SearchView) MenuItemCompat.getActionView(menuSearch); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query) { if (adapter != null) adapter.getFilter().filter(query); + searchView.clearFocus(); return true; }