我试图从parse.com的服务器查询一切正常,除了一件事,这是用于查询:
ParseQuery<ParseObject> query = ParseQuery.getQuery("TestNotes");
query.orderByDescending("createdAt");
query.fromLocalDatastore();
query.findInBackground(new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list,
ParseException e) {
if (e == null) {
if (list.size() <= 0) {
getNotesFromServer();
Toast.makeText(getActivity(), "No results", Toast.LENGTH_LONG).show();
}
for (ParseObject j : list) {
notesIDArray.add(j.getObjectId());
Format formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String s = formatter.format(j.getCreatedAt());
//problem is here
notesTimeStampArray.add(s);
Log.d("TimeStamp = " + notesTimeStampArray.add(s), " TimeStamp ");
Log.d("ObjectId = " + notesIDArray, " TimeStamp ");
}
} else {
e.getMessage();
Log.d("" + e.getMessage(), " error");
}}});
}
正如您所见,我在objectIds
及其createdAt
你可以看到我试图打印它们,看看我从查询中得到了什么 并且打印输出为:
D/TimeStamp = [2016-02-03 10:37:52, 2016-02-03 10:32:22, 2016-01-24 01:12:58]: TimeStamp
D/ObjectId = [gHFxggepVj, IfY7VBZcV4, Kh0qUl4pDw, 6PONATviwa, 2t0IJ251Py, N0QSGYnv1j]: TimeStamp
你可以看到timestamp
只有三个值且我的对象超过3个,所以任何想法都没有得到object's
createdAt
的所有值
请大家帮我解决过去3小时内的问题,但没有得到任何线索,任何线索或暗示对我都有帮助