I do not understand how it works, I have 3 activities with the same characteristics, all have a listiew, they all have a searchview, one of them works correctly, the detail is when in two of them when I'm in the searchview I press Backspace (delete) does not erase the search if I do not return to the previous activity, to which that event is due, in no time I have made a code that by pressing backspace I return,: S
the detail is when you press the backspace key, in theory you must delete the string that is searched in the listview, end it or return to the parent activity, attach the search view code;
SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);
SearchView searchView = (SearchView) menu.findItem(R.id.menu_buscar).getActionView();
searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));
searchView.setIconifiedByDefault(false);
SearchView.OnQueryTextListener textChangeListener = new SearchView.OnQueryTextListener()
{
@Override
public boolean onQueryTextChange(String newText)
{
ADA.getFilter().filter(newText);
return true;
}
@Override
public boolean onQueryTextSubmit(String query)
{
ADA.getFilter().filter(query);
return true;
}
};
searchView.setOnQueryTextListener(textChangeListener);