简体   繁体   中英

how to prevent position goes top after adding items into listview, and notifyDataSetChanged

    messages.addAll(0,lstLoadedTop10);

    adapter.notifyDataSetChanged();

the problem is.

after I add items into listview and doing notifyDataSetChanged();

the scrollbar goes top.

but I want to watch items on screen continuously.

for example. at the twitter app, the position doesn't goes up after loading more twit.

sorry about my poor English. thanks in advance.

If you are using ScrollView , it will be easy.

Try this: scrollTo(int x, int y) . Read more here

Good Luck

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM