我是quickblox的新手。谁能告诉我如何更新自定义对象中的记录?
例如,我想将字段中water
low
值更改为high
我刚刚在quickblox网站中尝试了代码,但它给了我错误
我试过了
String id = getIntent().getStringExtra(Consts.CUSTOMOBJ_ID);
QBCustomObject record = new QBCustomObject();
HashMap<String, Object> fields = new HashMap<String, Object>();
fields.put("mhs",mahasiswa_name.getText().toString());
record.setFields(fields);
record.setCustomObjectId(id);
QBCustomObjects.updateObject(record,null,new QBEntityCallback<QBCustomObject>(){
@Override
public void onSuccess(QBCustomObject qbCustomObject, Bundle bundle) {
}
@Override
public void onError(QBResponseException e) {
}
});
但是QBCustomObjects.updateObject
后给了我错误:
Cannot resolve method 'updateObject(com.quickblox.customobjects.model.QBCustomObject, null, anonymous com.quickblox.core.QBEntityCallback<com.quickblox.customobjects.model.QBCustomObject>)'
使用下一个方法:
QBCustomObjects.updateObject(qbCustomObject, qbRequestUpdateBuilder).performAsync(new QBEntityCallback<QBCustomObject>() {
@Override
public void onSuccess(QBCustomObject result, Bundle params) {
}
@Override
public void onError(QBResponseException responseException) {
}
});