Filtering custom adapter returning incorrect results

前端 未结 3 1358
盖世英雄少女心
盖世英雄少女心 2021-01-28 23:19

Check:

\"screenshot\"

I am trying to implement filter on my ListView. But I am facing a very s

3条回答
  •  终归单人心
    2021-01-28 23:32

    I have also implemented filter List View in my application. For that, I just need a snippet of code. Check it, if it helps.

    editText.addTextChangedListener(new TextWatcher() {
    
                public void onTextChanged(CharSequence arg0, int arg1, int arg2,
                        int arg3) {
    
                }
                public void beforeTextChanged(CharSequence arg0, int arg1,
                        int arg2, int arg3) {
    
                }
                public void afterTextChanged(Editable arg0) {
                    sendToList.this.adapter.getFilter().filter(arg0);
    
                }
            });
    

提交回复
热议问题