简体   繁体   中英

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.

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

                    }
                });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM