Hello,
I’m developing an android app and I want to make a logic layer for the queries of the database.
I have the following code:
Backendless.Persistence.of(Unit.class).find(dataQueryUnit, new AsyncCallback<BackendlessCollection<Unit>>() {
@Override
public void handleResponse(BackendlessCollection<Unit> unitBackendlessCollection) {
BackendlessCollection<Unit> resultUnits = unitBackendlessCollection;
List<Unit> unitList = resultUnits.getData();
int numberOfUnits = unitList.size();
}
@Override
public void handleFault(BackendlessFault backendlessFault) {
// Toast.makeText(SelectUnit.this, “error”, Toast.LENGTH_SHORT).show();
}
});
I want to make a function that returns the numberOfUnit variable. The problem is that I can’t access that variable.