本文整理汇总了Java中com.avos.avoscloud.AVQuery.setSkip方法的典型用法代码示例。如果您正苦于以下问题:Java AVQuery.setSkip方法的具体用法?Java AVQuery.setSkip怎么用?Java AVQuery.setSkip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avos.avoscloud.AVQuery
的用法示例。
在下文中一共展示了AVQuery.setSkip方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMoreNote
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<AVObject> getMoreNote(String user, int skip, int limit, boolean isFirst)
throws AVException {
AVQuery<AVObject> query = new AVQuery<>("Note");
query.whereEqualTo("user_tel", user);
query.orderByDescending("note_editedAt");
query.setLimit(limit);
query.setSkip(isFirst ? skip : 0);
return query.find();
}
示例2: getStory
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
/**
* 获取故事列表
*/
public void getStory(){
AVQuery<AVObject> query=new AVQuery<>("story");
query.setSkip(skip);
skip=skip+30;
query.setLimit(30);
query.orderByDescending("createdAt");
query.include("provider");//包括provider 避免重复查询
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if (e == null) {
for (AVObject item : list) {
storyList.add(item);
}
adapter.notifyDataSetChanged();
refreshLayout.setRefreshing(false);
} else {
Log.e("get story list error", e.toString());
}
}
});
}
示例3: getSomeWord
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
/**
* 获取随机的word
*/
private void getSomeWord(){
if(wordList!=null){
wordList.clear();
}
AVQuery<AVObject> query=new AVQuery<>("word");
query.setLimit(51);
query.setSkip(currentSkip);
currentSkip+=51;
query.whereEqualTo("lang", currentLang+"");
query.include("voiceFile");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if(e==null){
if(list.size()>0){
for(AVObject item:list){
wordList.add(item);
adapter.notifyDataSetChanged();
}
}else {
currentSkip=0;//如果达到了最后一组之后,则重新回到第一组
getSomeWord();
}
}else {
Log.e("获取词条失败",e.toString());
}
}
});
}
示例4: getNoticeListNext
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public void getNoticeListNext() {
AVQuery<AVObject> query = new AVQuery<AVObject>(APPCodeConst.TELEPHONE);
query.orderByAscending("ID");// 根据ID字段升序显示数据
query.setLimit(PER_PAGE); // 限制最多10个结果
query.setSkip(dataList.size());
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> avnoticeList, AVException e) {
// TODO Auto-generated method stub
if (e == null) {
// noticeList.clear();
Log.d("成功", "查询到" + avnoticeList.size() + " 条符合条件的数据");
try {
for (int i = 0; i < avnoticeList.size(); i++) {
AVObject avObject = avnoticeList.get(i);
TELEPHONE telephoneItem = new TELEPHONE();
telephoneItem.fromAV(avObject);
dataList.add(telephoneItem);
}
TelephoneModel.this.OnMessageResponse(APPCodeConst.TELEPHONE);
} catch (AVException ave) {
ave.printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
} else {
Log.d("失败", "查询错误: " + e.getMessage());
}
}
});
}
示例5: getNoticeListNext
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public void getNoticeListNext() {
AVQuery<AVObject> query = new AVQuery<AVObject>(APPCodeConst.NOTICE);
query.orderByAscending("ID");// 根据ID字段升序显示数据
query.setLimit(PER_PAGE); // 限制最多10个结果
query.setSkip(dataList.size());
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> avnoticeList, AVException e) {
// TODO Auto-generated method stub
if (e == null) {
// noticeList.clear();
Log.d("成功", "查询到" + avnoticeList.size() + " 条符合条件的数据");
try {
for (int i = 0; i < avnoticeList.size(); i++) {
AVObject avObject = avnoticeList.get(i);
NOTICE noticeItem = new NOTICE();
noticeItem.fromAV(avObject);
dataList.add(noticeItem);
}
NoticeModel.this.OnMessageResponse(APPCodeConst.NOTICE);
} catch (AVException ave) {
ave.printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
} else {
Log.d("失败", "查询错误: " + e.getMessage());
}
}
});
}
示例6: getNoticeListNext
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public void getNoticeListNext() {
AVQuery<AVObject> query = new AVQuery<AVObject>("pyp_NOTICE");
query.orderByAscending("ID");// 根据ID字段升序显示数据
query.setLimit(PER_PAGE); // 限制最多10个结果
query.setSkip(dataList.size());
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> avnoticeList, AVException e) {
// TODO Auto-generated method stub
if (e == null) {
// noticeList.clear();
Log.d("成功", "查询到" + avnoticeList.size() + " 条符合条件的数据");
try {
for (int i = 0; i < avnoticeList.size(); i++) {
AVObject avObject = avnoticeList.get(i);
NOTICE noticeItem = new NOTICE();
noticeItem.fromAV(avObject);
dataList.add(noticeItem);
}
NoticeModel.this.OnMessageResponse("NOTICE");
} catch (AVException ave) {
ave.printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
} else {
Log.d("失败", "查询错误: " + e.getMessage());
}
}
});
}
示例7: getNoticeListNext
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public void getNoticeListNext() {
AVQuery<AVObject> query = new AVQuery<AVObject>("pyp_NOTICE");
query.orderByAscending("ID");// 根据ID字段升序显示数据
query.setLimit(PER_PAGE); // 限制最多10个结果
query.setSkip(total);
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> avnoticeList, AVException e) {
// TODO Auto-generated method stub
if (e == null) {
// noticeList.clear();
Log.d("成功", "查询到" + avnoticeList.size() + " 条符合条件的数据");
try {
for (int i = 0; i < avnoticeList.size(); i++) {
AVObject avObject = avnoticeList.get(i);
NOTICE noticeItem = new NOTICE();
noticeItem.fromAV(avObject);
dataList.add(noticeItem);
}
total += PER_PAGE;
NoticeModel.this.OnMessageResponse("NOTICE");
} catch (AVException ave) {
ave.printStackTrace();
} catch (Exception e2) {
e2.printStackTrace();
}
} else {
Log.d("失败", "查询错误: " + e.getMessage());
}
}
});
}
示例8: doInBackground
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
@Override
protected Boolean doInBackground(Void... params) {
AVQuery<AVObject> query = new AVQuery<AVObject>(
"Comments");
query.whereEqualTo("vid", mAnimation.AnimationId);
query.setLimit(mStep);
query.setSkip(mSkip);
query.include("uid");
query.orderByDescending("updatedAt");
try {
List<AVObject> commentList = query.find();
if (commentList.size() < mStep) {
mCommentFinished = true;
}
ArrayList<LinearLayout> commentsLayout = new ArrayList<LinearLayout>();
for (AVObject comment : commentList) {
AVObject user = comment.getAVObject("uid");
Comment commentInformation = new Comment(
user.getString("username"),
user.getString("avatar"),
user.getString("platform"), comment.getUpdatedAt(),
comment.getString("content"));
LinearLayout commentItem = (LinearLayout) mLayoutInflater
.inflate(R.layout.comment_item, null);
TextView content = (TextView) commentItem
.findViewById(R.id.content);
content.setText(commentInformation.Content);
ImageView avatar = (ImageView) commentItem
.findViewById(R.id.avatar);
Picasso.with(mContext).load(commentInformation.Avatar)
.into(avatar);
TextView username = (TextView) commentItem
.findViewById(R.id.name);
username.setText(commentInformation.Username);
TextView date = (TextView) commentItem
.findViewById(R.id.time);
date.setText(mPrettyTime.format(commentInformation.Date));
commentsLayout.add(commentItem);
}
mSkip += mStep;
mCommentCount += commentList.size();
publishProgress(commentsLayout
.toArray(new LinearLayout[commentList.size()]));
return true;
} catch (AVException e) {
return false;
}
}