AVOSCloud.initialize("64YCVmVaL1IGszMB8Dg0qhmC-gzGzoHsz", "kxtJY6ULUkQG8eMcczpdACVB");
// 构建对象
AVObject todo = new AVObject("FirstDemo");
// 为属性赋值
todo.put("title", "马拉松报名");
todo.put("priority", 2);
// 将对象保存到云端
todo.saveInBackground().subscribe(new Observer() {
public void onSubscribe(Disposable disposable) {
}
public void onNext(AVObject todo) {
// 成功保存之后,执行其他逻辑
System.out.println("保存成功。objectId:" + todo.getObjectId());
}
public void onError(Throwable throwable) {
// 异常处理
}
public void onComplete() {
}
});