本文整理汇总了Java中com.avos.avoscloud.AVQuery.include方法的典型用法代码示例。如果您正苦于以下问题:Java AVQuery.include方法的具体用法?Java AVQuery.include怎么用?Java AVQuery.include使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.avos.avoscloud.AVQuery
的用法示例。
在下文中一共展示了AVQuery.include方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getData
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
/**
* 获取音/视频资源
*/
private void getData(){
AVQuery<AVObject> query=new AVQuery<>("jxh");
// query.whereEqualTo("isVoice",false);
query.setLimit(1000);
query.orderByDescending("viewcount");
query.include("cover");
query.whereExists("cover");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if(e==null){
mList= (LinkedList<AVObject>) list;
if(adapter!=null)
adapter.notifyDataSetChanged();
}else {
Log.e("getVoice",e.toString());
}
}
});
}
示例2: refreshData
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
private void refreshData() {
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.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mSwipeRefreshLayout.setRefreshing(false);
if (e == null) {
if (!list.isEmpty()) {
mData.clear();
mData.addAll(list);
mAdapter.notifyDataSetChanged();
mOffset = list.get(list.size() - 1).getInt("ideaId");
}
} else {
e.printStackTrace();
}
}
});
}
示例3: 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();
}
}
});
}
示例4: loadData
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
/**
* 加载数据
*
* @param isRefresh true:数据刷新 false: 加载更多
*/
private void loadData(boolean isRefresh) {
if (isRefresh) {
AVQuery<AVObject> query = new AVQuery<>("user_collect");
query.whereEqualTo("user", AVUser.getCurrentUser());
query.include("idea");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
mRefreshLayout.setRefreshing(false);
if (e == null) {
mData.addAll(list);
mAdapter.notifyDataSetChanged();
} else {
e.printStackTrace();
}
}
});
}
}
示例5: loadData
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
private void loadData() {
AVQuery<AVObject> query = new AVQuery<AVObject>("idea");
query.whereEqualTo("objectId", objectId);
query.include("user");
query.findInBackground(new FindCallback<AVObject>() {
@Override
public void done(List<AVObject> list, AVException e) {
if (e == null) {
if (list.size() == 1) {
mIdea = list.get(0);
showToast("数据加载完毕");
}
}
}
});
}
示例6: findAddRequests
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public void findAddRequests(int skip, int limit, FindCallback findCallback) {
AVUser user = HiTalkHelper.getInstance().getCurrentUser();
AVQuery<AddRequest> q = AVObject.getQuery(AddRequest.class);
q.include(AddRequest.FROM_USER);
q.skip(skip);
q.limit(limit);
q.whereEqualTo(AddRequest.TO_USER, user);
q.orderByDescending(AVObject.CREATED_AT);
q.setCachePolicy(AVQuery.CachePolicy.NETWORK_ELSE_CACHE);
q.findInBackground(findCallback);
}
示例7: 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;
}
示例8: refreshDataQuery
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
private AVQuery<BnRemote> refreshDataQuery(){
AVQuery<BnRemote> query = AVQuery.getQuery(BnRemote.class);
initQuery(query);
query.limit(18);
query.whereEqualTo("isAll",true);
query.orderByDescending(BnItem.getCreateTimeFieldName());
query.include(BnItem.getUserName());
return query;
}
示例9: 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());
}
}
});
}
示例10: 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());
}
}
});
}
示例11: findAddRequests
import com.avos.avoscloud.AVQuery; //导入方法依赖的package包/类
public static List<AddRequest> findAddRequests() throws AVException {
AVUser user = AVUser.getCurrentUser();
AVQuery<AddRequest> q = AVObject.getQuery(AddRequest.class);
q.include(AddRequest.FROM_USER);
q.whereEqualTo(AddRequest.TO_USER, user);
q.orderByDescending("createdAt");
q.setCachePolicy(AVQuery.CachePolicy.NETWORK_ELSE_CACHE);
return q.find();
}
示例12: 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) {
}
}
}
});
}
示例13: 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;
}
}