【问题标题】:Quickblox update recordQuickblox 更新记录
【发布时间】:2018-10-25 11:31:50
【问题描述】:

我是 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>)'

【问题讨论】:

  • 请向我们展示您到目前为止所做的尝试。另外,请确保发布您面临的错误,否则我们无法回答问题。谢谢。
  • 抱歉,我已经编辑了我的问题

标签: android quickblox quickblox-android


【解决方案1】:

使用下一个方法:

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

            }

            @Override
            public void onError(QBResponseException responseException) {

            }
        });

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多