Hello everyone.
I'm trying to do simple app that has a listview, listview is populated with info from json file.
20 items downloaded at a time. And when user is scrolling to the bottom next 20 items are loaded.
Problem is when my app loads next 20 items the scrollbar jumps to the top, so i need to scroll all the way down to load next 20. What I would like it to do is to stay on the same spot, where it was before loading(respectively, what i mean is the scroll bar will become shorter and the same list items should be visible). I hope you understand what I wish to achieve.
Please help me.
Thank you :)

3 Years
Discussion Span
Last Post by Nomorewine

Inside setOnScrollListener ...

public void onScroll(AbsListView view, int firstVisibleItem,
                    int visibleItemCount, int totalItemCount) {
                // TODO Auto-generated method stub
                    x = firstVisibleItem;
                    int index = lv.getFirstVisiblePosition();
                    View v = lv.getChildAt(0);
                    int top = (v == null) ? 0 : v.getTop();
                    listLoader();// loading 20 items more
                    lv.setSelectionFromTop(index, top);



to make changes visible.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.