android使用SearchView控件查询时弹出黑色提示框的解决方法
本人使用SearchView对Listviewj进行查询时,弹出类似下图的
提示框:
解决方法:
不使用listview过滤,使用适配器过滤(注释:下面代码中的"a"是你的适配器的名称,而且适配器不一定是ArrayAdapter,我用的SimpleAdapter):
public boolean onQueryTextChange(String newText) {
// TODO Auto-generated method stub
a.getFilter().filter(newText);//通过适配器过滤
return true;
}
改完后出现下图:
成功解决。