1

I'm new to quickblox. Can anyone tell me how to update a record in custom object?

For example I want to change the low value in water field to high I just tried the code in quickblox website but it gives me error

I tried

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) {

    }
});

but it gives me error after QBCustomObjects.updateObject:

 Cannot resolve method 'updateObject(com.quickblox.customobjects.model.QBCustomObject, null, anonymous
 com.quickblox.core.QBEntityCallback<com.quickblox.customobjects.model.QBCustomObject>)'
CoolMind
  • 26,736
  • 15
  • 188
  • 224

1 Answers1

0

Use the next method:

            QBCustomObjects.updateObject(qbCustomObject, qbRequestUpdateBuilder).performAsync(new QBEntityCallback<QBCustomObject>() {
            @Override
            public void onSuccess(QBCustomObject result, Bundle params) {

            }

            @Override
            public void onError(QBResponseException responseException) {

            }
        });
RustyBoy
  • 26
  • 2