Search code examples
androidcloudboost

Cannot resolve symbol CloudSearchCallback()


I'm working on CloudBoost with android and I need to query some data stored. I can't use this query command : query.find(new CloudSearchCallback()).

Android Studio says:

"Cannot resolve symbol CloudSearchCallback()"

I have ensured that I added necessary libraries like :JavaSDK-1.0.7, okhttp-2.4.0, okhttp-ws-2.4.0, okio-1.4.0, socket-client.

Thanks for some help.


Solution

  • There is no callback interface called CloudSearchCallback() in CloudBoost. However CloudQuery.find returns CloudObject's matching your query criteria. So you are supposed to use CloudObjectArrayCallback and override the done method which returns an CloudObject[] if all goes well and/or CloudException in case something goes wrong. Replace your code with something like this:

                        query.find(new CloudObjectArrayCallback() {
    
                        @Override
                        public void done(CloudObject[] x, CloudException e) throws CloudException {
                            if(e!=null)
                                //handle exception
                            else if(x!=null)
                                //process returned records
    
                        }
                    });