mirror of https://github.com/M66B/NetGuard.git
Hide keyboard on search submit
This commit is contained in:
parent
64b00b73b8
commit
d9bf4682b6
|
@ -495,12 +495,13 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
menuSearch = menu.findItem(R.id.menu_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() {
|
searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
if (adapter != null)
|
if (adapter != null)
|
||||||
adapter.getFilter().filter(query);
|
adapter.getFilter().filter(query);
|
||||||
|
searchView.clearFocus();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue