【问题标题】:Can't update Parse Object无法更新解析对象
【发布时间】:2015-08-17 20:05:08
【问题描述】:

我之前创建了一个对象,现在尝试在“编辑”屏幕中更新它

对象的 id 是正确的(因为它在活动早期正确查询以更新文本标签。这应该在单击按钮时保存。

ParseQuery<ParseObject> query = ParseQuery.getQuery("Product");
                    Intent i = getIntent();
                    String queryString = i.getStringExtra("id");
                    query.getInBackground(queryString, new GetCallback<ParseObject>() {
                        public void done(ParseObject editProduct, ParseException e) {
                            if (e == null) {
                                editProduct.put("productName", ProductName.getText().toString());
                                editProduct.put("ISDN", ISDN_text.getText().toString());
                                editProduct.put("expiry", expiry_date.getText().toString());
                                editProduct.put("type", spinnercategory.getSelectedItem().toString());
                                editProduct.put("quantity", quantity.getText().toString());
                                editProduct.put("username", "Admin");
                                editProduct.put("shoppingList", true);
                                editProduct.put("mainList", false);
                                editProduct.saveInBackground();
                          }
                        }
                    });

这是从 Parse Android 开发人员指南中提取的,但似乎不起作用。任何建议

【问题讨论】:

    标签: parse-platform updating


    【解决方案1】:

    想通了。有点。

    editProduct.put("expiry", expiry_date.getText().toString()); 是打破它的行。我正在尝试将字符串传递给后端定义为日期的内容,这显然会取消整个保存操作。

    暂时在我的解决方案中对此进行注释,直到我可以解决日期问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-01-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-23
      相关资源
      最近更新 更多