Android: Prevent text field pop-up when entering text in a SearchView

醉酒当歌 提交于 2019-12-03 16:56:12

i found out how to get rid of that ugly popup window. The trick is to work with filter directly.The code below assumes you have implemented filterable in your customAdapter.

public boolean onQueryTextChange(String newText) {
    if (TextUtils.isEmpty(newText)) {
       m_listView.clearTextFilter();
    } else {
       ContactsAdapter ca = (ContactsAdapter)lv.getAdapter();
       ca.getFilter().filter(newText);
       //following line was causing the ugly popup window.
       //m_listView.setFilterText(newText);
    }
   return true;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!