执行以下代码时,我在日志中得到以下信息
05-02 02:19:34.175 8796-8810/com.example.nitikamehta.testing I/System.out: io.cloudboost.CloudException
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CloudApp.init("vuwzaiqgwytr ", "cf358f99-1bbd-4ccc-9a4e-3370b169a50f");
myAsyncTask mTask = new myAsyncTask();
mTask.execute("abc", "10", "Hello world");
}
private class myAsyncTask extends AsyncTask<String, Integer, String> {
String mTAG = "myAsyncTask";
@Override
protected void onPreExecute() {
}
@Override
protected String doInBackground(String... arg) {
CloudObject obj = new CloudObject("users");
try {
obj.set("name", "navneet");
Log.d("here", "also");
} catch (CloudException e) {
e.printStackTrace();
}
try {
obj.save(new CloudObjectCallback() {
@Override
public void done(CloudObject x,CloudException t) {
if (x != null) {
Log.d("first", "added");
}
if (t != null) {
System.out.println(""+t);
}
}
}
);
} catch (CloudException e) {
Log.d("hello", "world");
}
return "done";
}
@Override
protected void onPostExecute(String result) {
Log.d(mTAG, "Inside onPostExecute");
}
}
}