Support Topics Documentation Slack YouTube Blog

Cannot load more than 10 records


(Jason Brown) #1

Hello, I am using the following code to extract data from the tables, it only retrieves 10 records. Please help

array = new ArrayList<>();

queryBuilder = DataQueryBuilder.create();

CustomProgressDialog(“Loading…please wait”);

Backendless.Persistence.of(ObservedIKIndicators.class).find(queryBuilder, new AsyncCallback<List<ObservedIKIndicators>>() {
@Override
public void handleResponse(List<ObservedIKIndicators> response) {
for (int i = 0; i <response.size() ; i++)
{
if (response.get(i).getUser().equals(userEmail))
{

array.add(response.get(i));
// array.add(new ObservedIKIndicators(response.get(i).getUser(),
// response.get(i).getIndicatorName(),response.get(i).getImageUrl(),
// response.get(i).getLocation(),response.get(i).getStatus(),response.get(i).getCreated()));
}

}
adapter = new History_Adapter(getApplicationContext(), array);

lvHistory.setAdapter(adapter);

Global_Class.ShowToast(getApplicationContext(),“Download successful”);
progressDialog.dismiss();
}

@Override
public void handleFault(BackendlessFault fault) {

Global_Class.ShowToast(getApplicationContext(),"Error: "+ fault.getMessage());
progressDialog.dismiss();
}
});


(Vladimir Yalovy) #2

Hello @Jason_Brown1

Maybe this topic - How to optimize a Find query for a Hierarchy of objects to get all of the objects instead of just 10 - help you.


(Jason Brown) #3

Hi, I’m not sure what you are telling me to do in the thread you linked.


(Vladimir Upirov) #5

Hi Jonas
I guess you are looking for “setPageSize” method and here it is https://backendless.com/docs/android/data_data_paging.html
Regards, Vlad


(Jason Brown) #6

Dear Vlad,

I would like to thank you kindly for your quick response, this was indeed the information I needed.

Kind regards,

Jason