Search in ListView with EditText

前端 未结 3 1046
栀梦
栀梦 2020-11-27 07:58

I have a ListView. Each row of it contains 3 TextView\'s and 2 Button\'s. Above it I have an EditText. How can I filter m

3条回答
  •  不知归路
    2020-11-27 08:38

    create some array list for the listview ..And on "AddTextChangeListener" you can search for similar items in the list and load a new arraylist for the searched text...

    edittext.addTextChangedListener(new TextWatcher(){
    public void afterTextChanged(Editable s) {
         //search for the keyword and add the items to a new arraylist
    }
    

提交回复
热议问题