How to do infinite scroll in android using Volley request

I have a listview in action that displays the list values ​​obtained from a JSON response. I can successfully display the list view as shown below.

listView = (ListView) findViewById(R.id.list);
        adapter = new CustomListAdapter(this, productList);
        listView.setAdapter(adapter);



        pDialog = new ProgressDialog(this);
        // Showing progress dialog before making http request
        pDialog.setMessage("Loading...");
        pDialog.show();

        GsonRequest<Product[]> getPersons =
                new GsonRequest<Product[]>(Request.Method.GET,url, Product[].class,

                        requestSuccessListener(), requestErrorListener());

        AppController.getInstance().addToRequestQueue(getPersons);

      

Now, when the user scrolls to the bottom of the list, I want to load additional information with another REST call. Please help me on how to perform this operation so that the previous data in the adapter does not change and should be added below.

Thanks in advance.

+3


source to share


1 answer


for infinite scrolling see here https://github.com/codepath/android_guides/wiki/Endless-Scrolling-with-AdapterViews-and-RecyclerView .. for each customLoadMoreDataFromApi(page)

load adapter load and change call notification set ..



+2


source







All Articles