解析不保存文件。将添加和删除。 (机器人)

时间:2013-06-24 13:05:45

标签: android save parse-platform

再次是我。

我有一个解析查询,它获取一个解析对象,然后放入新值并保存它。代码如下:

ParseQuery<ParseObject> o = new ParseQuery("DreamCloud");
o.whereEqualTo("objectId", id); // id is a variable earlier that contains the 
                                //               id of the object I'm looking up

o.findInBackground(new FindCallback<ParseObject>() {
    @Override
    public void done(List<ParseObject> parseObjects, ParseException e) {
       if (parseObjects.size() > 0)
       {
          ParseObject p = parseObjects.get(0);  // should only return one
          if (id != null) //extra check just in case. I know it's redundant
          {
             p.put("title", t.getText().toString());
             p.put("dream", d.getText().toString());
          }

          try
          {
             if (p != null) //another extra check
             {
                p.saveInBackground(); //obviously not saving
             }
          } catch (Exception el) {
             Toast.makeText(getApplication().getApplicationContext(), 
                               "Sorry, this feature is currently unavailable",
                                  Toast.LENGTH_SHORT);
                    }
                } else {}
            }
        });

我甚至稍后检查了获取已放入p的值,但p不保存,所以当我稍后请求它时,它不会更改为新值。

有人提出任何线索吗?

0 个答案:

没有答案