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
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue