嗨,我想在我的 Android 应用程序(如 Whatsapp)中添加一个搜索小部件,其中用户单击搜索按钮并显示用户结果......我已经在我的自定义列表视图中实现了搜索逻辑,现在我想分离我的搜索逻辑和 Listview Logic ... 我缺少的是当没有找到用户时显示一个屏幕说没有用户,并在 ActionBar 中实现搜索按钮
下面是我的搜索逻辑代码...
EditText editTxt = (EditText) findViewById(R.id.inputSearch);          
// <To Implement No results Found>
editTxt.addTextChangedListener(new TextWatcher() {
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {
            if (count < before) {
                // We're deleting char so we need to reset the adapter data
                bindingData.resetData();
            }
            bindingData.getFilter().filter(s.toString());
        }
        /*Auto Generated Methods */
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count,
                int after) {
        }
        @Override
        public void afterTextChanged(Editable s) {
        }
    });