再次是我。
我有一个解析查询,它获取一个解析对象,然后放入新值并保存它。代码如下:
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不保存,所以当我稍后请求它时,它不会更改为新值。
有人提出任何线索吗?