When you try to implement searchView, you add override two method onQueryTextSubmit and onQueryTextChange. The dilema occur when user try to press "search icon" on Soft Keyboard, which launch onQueryTextSubmit.
Solution:
It was because the query is null, (Android HATES null) so all I need to do is change it into empty String and request a focus.
@Override public boolean onQueryTextSubmit(String query) { searchView.setQuery("", false); searchView.requestFocus(); return true; }
No comments:
Post a Comment