Developer
Developer

Reputation: 1813

Android - scrolling down listView at the bottom

I'm using a custom ListView in android to display somedata ... By default i made the size of the ListView to be 25. I want when the user scoll down at the buttom of the listView to display another 25 views in addition to the previous one ( The list now should display 50 elements)

How can be this implemented?

Upvotes: 0

Views: 710

Answers (1)

Zaz Gmy
Zaz Gmy

Reputation: 4356

try to use this

ListView lv = (ListView)findViewById(R.id.list_view);
lv.setOnScrollListener(new OnScrollListener() {
    @Override
    public void onScroll(AbsListView view, int firstVisibleItem, 
        int visibleItemCount, int totalItemCount) {


            //load more content

    }
});

Upvotes: 1

Related Questions