本文整理汇总了Java中com.avos.avoscloud.AVQuery.whereLessThan方法的典型用法代码示例。如果您正苦于以下问题:Java AVQuery.whereLessThan方法的具体用法?Java AVQuery.whereLessThan怎么用?Java AVQuery.whereLessThan使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avos.avoscloud.AVQuery
的用法示例。
在下文中一共展示了AVQuery.whereLessThan方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadMoreData
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
private void loadMoreData() {
AVUser user = AVUser.getCurrentUser();
AVQuery<AVObject> query = new AVQuery<>("user_join");
query.setLimit(1);
query.whereEqualTo("user", user);
query.include("idea");
query.include("idea.user");
query.orderByDescending("createAt");
query.whereLessThan("ideaId", mOffset);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
if (!list.isEmpty()) {
mData.addAll(list);
mAdapter.notifyDataSetChanged();
mOffset = list.get(list.size() - 1).getInt("ideaId");
}
} else {
e.printStackTrace();
}
}
});
}
示例2: loadMoreData
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
private void loadMoreData() {
AVQuery<AVObject> query = new AVQuery<>("idea");
query.setLimit(1);
query.whereEqualTo("user", AVUser.getCurrentUser());
query.orderByDescending("createdAt");
query.whereLessThan("ideaId", mOffset);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
if (!list.isEmpty()) {
mData.addAll(list);
mAdapter.notifyDataSetChanged();
mOffset = list.get(list.size() - 1).getInt("ideaId");
}
}else {
e.printStackTrace();
}
}
});
}
示例3: loadMoreDataQuery
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
private AVQuery<BnRemote> loadMoreDataQuery(BnItem lastBnItem){
AVQuery<BnRemote> query = AVQuery.getQuery(BnRemote.class);
initQuery(query);
query.limit(18);
query.whereEqualTo("isAll",true);
query.orderByDescending(BnItem.getCreateTimeFieldName());
query.include(BnItem.getUserName());
query.whereLessThan(BnItem.getCreateTimeFieldName(),lastBnItem.getCreateTime());
return query;
}
示例4: loadNotTopicData
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
private void loadNotTopicData(final boolean isRefresh) {
final AVQuery<AVObject> query = new AVQuery<>("idea");
query.whereNotEqualTo("tag", 1);
query.orderByDescending("createdAt");
query.setLimit(1);
query.include("user");
if (!isRefresh) {
query.whereLessThan("ideaId", mOffset);
}
query.setCachePolicy(AVQuery.CachePolicy.NETWORK_ELSE_CACHE);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
if (!list.isEmpty()) {
for (AVObject object : list) {
int id = object.getInt("ideaId");
Log.i("id--->", id + "");
}
mOffset = list.get(list.size() - 1).getInt("ideaId");
Log.i("mOffset", mOffset + "");
if (isRefresh) {
mData.addAll(topicNum, list);
} else {
mData.addAll(list);
mPager++;
}
mAdapter.notifyDataSetChanged();
if (!NetworkUtil.isNetworkConnected(getActivity())) {
showToast(getActivity(), "网络错误");
}
} else {
showToast(getActivity(), "没有更多数据了");
}
} else {
e.printStackTrace();
if (e.getCode() == AVException.CACHE_MISS) {
}
}
}
});
}