How to refer to the original position of a list item when text filter is enabled?

后端 未结 4 890
甜味超标
甜味超标 2021-01-15 13:58

When I use edit text to filter the items, the list positions get all messed up and the items no longer call the proper intent. Any help is appreciated

lv.se         


        
4条回答
  •  被撕碎了的回忆
    2021-01-15 14:23

    if you use ViewHolder in Adapter just define a realPosition variable in holder class and set it in YourAdapter.getView

    and in listClick Listener

     ContactAdapter.ViewHolder holder = (YourAdapter.ViewHolder) view.getTag();
     holder.realPosition
    

提交回复
热议问题