how to do load next items on Paged Data Retrieval ??

i read this article on Paged Data Retrieval but still i didnt figured out how can i load the next pages’s item via a button click right now am loading my items like this
BackendlessDataQuery dataQuery = new BackendlessDataQuery();
dataQuery.setPageSize(10);
dataQuery.setWhereClause(whereClause);
Backendless.Data.of(Note.class).find(dataQuery, new AsyncCallback<BackendlessCollection<Note>>() {
@Override
public void handleResponse(BackendlessCollection<Note> notes) { // here i got my first 10 objects } @Override
public void handleFault(BackendlessFault fault) {
swipeToReload.setRefreshing(false);
Toast.makeText(getContext(), “” + fault.getMessage(), Toast.LENGTH_LONG).show();
}
});
so now how can i load next 10 items when user wants the next item (from a button)

Hi,
In your ‘handlerResponse’ function you will get the instance of BackendlessCollection class (in your case it is named ‘notes’).
This instance has method ‘nextPage’ what you should use for getting next page of data.
If you work in the async mode you have to provide a callback function to method ‘nextPage’.
You can see how it better to do on mentioned page in the fourth listing of code (it begins after the phrase ‘Now the backend is ready to show the power of paging. The following code demonstrates just that:’ ).
Regards, Ilya

hey man @ilya thanks for responding but am still confused , we can call the nextPage() function inside the response right ? so what if i want to fetch that next page on a button click ? how am gonna call the nextPage() function from a button’s onClickListener ??

Hi @Billion Bucks,
Just store your BackendlessCollection to some static field outside the listener.
Artur

hey @Artur , thanks a lot for responding i would like to tell you that ilya’s answer solved my question already well thanks again

@Billion Bucks, I am glad to hear it.
Have fun with Backendless,
Artur