Search code examples
androidlistviewandroid-layoutscrollandroid-scrollview

Disable scrolling in listview on refresh


the problem is I so some changes on the list and than it is always scrolling to the top. I know that I can make to scroll to the bottom but that is not what I want. I want to disable scrolling, I mean when I do a change on the list I want the to stay there I do not want to scroll to the top. I just want my scroll to do not change(just to stay in the same place where it is) I try to do this to set the transcrip mode of the list to disabled, but it still after the change the list go to the top.

lv.setTranscriptMode(AbsListView.TRANSCRIPT_MODE_DISABLED);

Solution

  • If you call setAdapter you can't avoid that your list is scrolling back to top. But it will stay at the same position if you call notifyDataSetChanged on the list adapter.