所以我试图从Parse回顾所有对象。我知道解析有1000的限制,但我找到了一些解决方案,允许我翻阅结果。但是,我无法让这些解决方案起作用。想知道以前是否有人处理过此事。
声明用于存储完整数据的全局变量
private static List<ParseObject>allObjects;
allObjects = new ArrayList<ParseObject>();
ParseQuery<ParseObject> query3 = ParseQuery.getQuery("HashTag");
query3.whereExists("Tag");
query3.setLimit(1000);
query3.findInBackground(getallobjects());
回调方法:
int limit = 1000;
int skip = 0;
private FindCallback<ParseObject> getallobjects() {
return new FindCallback<ParseObject>() {
@Override
public void done(List<ParseObject> list, ParseException e) {
allObjects.addAll(list);
if (list.size() == limit) {
skip = skip + limit;
ParseQuery<ParseObject> query = ParseQuery
.getQuery("HashTag");
query.setSkip(skip);
query.setLimit(limit);
query.findInBackground(getallobjects());
}
else {
//you have full data in allobjects
for (int i = 0; i < allObjects.size(); i++) {}
}
问题似乎是“getallobjects”没有解决,我无法让错误消失。