use of com.itculturalfestival.smartcampus.entity.db.Lost in project SmartCampus by Vegen.
the class LostAndFoundPresenter method getLostList.
@Override
public void getLostList(int SKIP, int skip) {
BmobQuery<Lost> query = new BmobQuery<Lost>();
// query.setCachePolicy(BmobQuery.CachePolicy.CACHE_THEN_NETWORK); // 先从缓存获取数据,如果没有,再从网络获取。
// 按照时间降序
query.order("-createdAt");
// 每次加载条数
query.setLimit(SKIP);
// 偏移量
query.setSkip(skip);
Subscription subscription = query.findObjects(new FindListener<Lost>() {
@Override
public void done(List<Lost> list, BmobException e) {
if (mView != null) {
if (e == null) {
// 请求成功
mView.showLostList(list);
mView.hideLoading(false);
if (list == null || list.isEmpty()) {
mView.loadMoreEnd(true);
}
} else {
mView.showMessage(HttpError.getErrorMessage(e));
mView.hideLoading(true);
mView.loadMoreFail();
}
}
}
});
mHttpLinkers.add(new SubscriptionHolder(subscription));
}
Aggregations