我在解析云上保存数据但无法使用ParseQuery检索它。我现在不知道出了什么问题?是否有任何登录或注册功能使用Parse API或其他任何东西。请提出任何解决方案。
保存数据代码:
ParseObject pObj = new ParseObject("CardTable");
pObj.put("name", edEmpName.getText().toString());
pObj.put("fromDate", btnTimeFrame1.getText().toString());
pObj.put("toDate", btnTimeFrame2.getText().toString());
pObj.saveInBackground();
获取数据:
ParseQuery<ParseObject> query = ParseQuery.getQuery("CardTable");
query.whereEqualTo("name", bundle.getString("EMP_NAME"));
query.findInBackground(new FindCallback<ParseObject>() {
public void done(List<ParseObject> scoreList, ParseException e) {
if (e == null) {
Log.d("score", "Retrieved " + scoreList.size() + " scores");
Toast.makeText(TimeCardWeeksActivity.this, scoreList.get(scoreList.size()-1).getString("name"), Toast.LENGTH_SHORT).show();
} else {
Log.d("score", "Error: " + e.getMessage());
Toast.makeText(TimeCardWeeksActivity.this, "failure", Toast.LENGTH_SHORT).show();
}
}
});
提前致谢。