Android Listview Search filter

后端 未结 2 1521
太阳男子
太阳男子 2021-01-27 08:48

I am trying to make a list view search for Android. I have found many tutorials that do just that where a search-bar is placed at the top and if you type in the box the results

2条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-27 09:16

    Rather than products[position], use adapter.getItem(position). When the ListView is not in filter mode, those two things will be the same. But, in filter mode, getItem() will take the filtering into account.

提交回复
热议问题