user669444
user669444

Reputation: 133

Listview goes on top on adding new item to adapter and setting it

I have a Listview, in which on reaching the end of the list I'm adding a few more items to the adapter and calling "notifydatasetchanged". The items are added properly to the end of the list, but the problem is the Listview is scrolled back to the top and points to the first item. I am using a custom adapter by the way. I want the List to remain at the place where I was at instead of scrolling all the way to the top. It should just behave like a normal listview without the user knowing that I'm lazyloading the items. Kindly help. I've been breaking my head over this for the whole of yesterday. Thanks.

Upvotes: 1

Views: 737

Answers (1)

nithinreddy
nithinreddy

Reputation: 6197

You are actually creating a new adapter again as u get items, which will reload the list view. To avoid it, just try to update the content of adapter.

Upvotes: 1

Related Questions