简体   繁体   中英

Problems in saving data with Android on CloudBoost

I'm using CloudBoost for Android application and i had some problems when I try to save save a data in a table, I'm not getting any results. This is my code:

CloudApp.init("*****", "*****");
...
new Thread(new Runnable() {
                    @Override
                    public void run() {
                        CloudObject obj = new CloudObject("User", "1uvSDThQ");
                        Log.e("LOG", "1"); //Already this is not shown
                        try {
                            obj.set("color", "#000000");
                            obj.setAcl(new ACL());
                            obj.save(new CloudObjectCallback() {
                                @Override
                                public void done(final CloudObject x, final CloudException e) {

                                    if(e != null)
                                        //error
                                        Log.e("LOG", "Errore");
                                    if(x!=null)
                                        //cloudObject
                                        Log.e("LOG", "FATTO");


                                }
                            });
                        } catch (CloudException e) {
                            e.printStackTrace();
                        }

                    }
                });

Your log isn't shown because you made a Thread without calling start() .

Android typically uses Asynctask anyway, but I'm not sure why you really need a Thread with this library... That save method looks asynchronous

CloudApp.init("*****", "*****")
CloudObject obj = new CloudObject("User", "1uvSDThQ");
Log.e("LOG", "1"); 
try {
    obj.set("color", "#000000");
    obj.setAcl(new ACL());
    obj.save(new CloudObjectCallback() {
        @Override

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