notifyDataSetChanged() makes the list refresh and scroll jumps back to the top

前端 未结 5 1568
自闭症患者
自闭症患者 2020-11-27 05:13

I am trying to implement an endless scroll listview but when I call notifyDataSetChanged() the whole list refreshes then the scroll position goes back to the to

5条回答
  •  攒了一身酷
    2020-11-27 05:37

    @Yarth's answer helped I'll just add on one small problem that I've just found that caused this, if you call

    listview.setVisibility(View.VISIBLE);
    

    will also cause the whole list to be scrolled to the top.

提交回复
热议问题