Custom Filtering ArrayAdapter in ListView

前端 未结 4 1018
孤独总比滥情好
孤独总比滥情好 2020-12-01 05:18

I am a begginer in Android but I tried to make a custom listview filtering and I it worked somehow. The only problem I have is that the ArrayList that I kept all the values

4条回答
  •  無奈伤痛
    2020-12-01 05:47

    Your problem are this lines:

    this.original = items;
    this.fitems = items;
    

    Items is the list you use for your ListView and putting it in two different variables does not make two different lists out of it. You are only giving the list items two different names.

    You can use:

    this.fitems = new ArrayList(items);
    

    that should generate a new List and changes on this list will only change the fitems list.

提交回复
热议问题