• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GetCallback类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.avos.avoscloud.GetCallback的典型用法代码示例。如果您正苦于以下问题:Java GetCallback类的具体用法?Java GetCallback怎么用?Java GetCallback使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GetCallback类属于com.avos.avoscloud包,在下文中一共展示了GetCallback类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: initCurrentAVuser

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
private void initCurrentAVuser(final ActionCallback callback){
    if (mCurrentUser == null) {
        AVQuery<AVUser> query = AVUser.getQuery();
        query.whereEqualTo("objectId",AVUser.getCurrentUser().getObjectId());
        query.setCachePolicy(AVQuery.CachePolicy.NETWORK_ELSE_CACHE);
        query.getFirstInBackground(new GetCallback<AVUser>() {
            @Override
            public void done(AVUser avUser, AVException e) {
                if (avUser != null){
                    mCurrentUser = avUser;
                    callback.onSuccess();
                }else {
                    mCurrentUser = AVUser.getCurrentUser();
                    callback.onError(0,e.getMessage());
                }
            }
        });
    }
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:20,代码来源:HiTalkHelper.java


示例2: setUnableToSuggest

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
public static void setUnableToSuggest(String txtUser){
    AVQuery<AVObject> query = new AVQuery<>("mUser");
    query.whereEqualTo("user_tel", txtUser);
    query.getFirstInBackground(new GetCallback<AVObject>() {
        @Override
        public void done(AVObject avObject, AVException e) {
            if (e == null) {
                avObject.put("isAbleToSuggest", false);
                avObject.saveInBackground();
            } else {
                Trace.e("设置isAbleToSuggest false失败");
                e.printStackTrace();
            }
        }
    });
}
 
开发者ID:hkq325800,项目名称:YellowNote,代码行数:17,代码来源:ShareSuggestService.java


示例3: loadShot

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
private void loadShot(String objectId,final Bundle savedInstanceState){
    //传递过来的 Shot需要 通过Id获取,并且重新查找属性
    AVService.fetchShotById(objectId, new GetCallback<AVObject>() {
        @Override
        public void done(AVObject shot, AVException arg1) {
            if (shot != null) {
                mUserID=shot.getString(ShotDAO.USER_ID);
                mUserAvatar=shot.getString(ShotDAO.USER_AVATAR);
                mUserName=shot.getString(ShotDAO.USER_NAME);
                mImageUrl= shot.getString(ShotDAO.IMAGE_URL);
                mTitle= shot.getString(ShotDAO.TITLE);
                mGitHub_Url= shot.getString(ShotDAO.GITHUB_URL);
                mDescription= shot.getString(ShotDAO.DESCRIPTION);
                CreateAt=shot.getCreatedAt();
                UpdatedAt=shot.getUpdatedAt();
                bindShot(true, savedInstanceState != null);

            }
        }
    });

}
 
开发者ID:OldDriver007,项目名称:OldDriver-master,代码行数:23,代码来源:DribbbleShot.java


示例4: loadPlayerById

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
private void loadPlayerById(final String userId) {
    AVService.fetchAVUserById(userId, new GetCallback<AVObject>() {
        @Override
        public void done(AVObject avuser, AVException e) {

            if(e!=null){
                Log.d("wdsy",e.getMessage()+"/"+userId);

            }else {
                if (avuser != null) {
                    username = avuser.getString(UserDAO.NAME);
                    avatar_url = avuser.getString(UserDAO.AVATAR_URL);
                    bindPlayer();
                }

            }
        }
    });
}
 
开发者ID:OldDriver007,项目名称:OldDriver-master,代码行数:20,代码来源:PlayerActivity.java


示例5: refresh

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
/**
 * 刷新显示,如从登录activity返回后
 */
public  void refresh(){
    user=AVUser.getCurrentUser();

    getListViewData();

    if(user!=null){
        user.fetchInBackground("logo", new GetCallback<AVObject>() {
            @Override
            public void done(AVObject avObject, AVException e) {
                if(e==null){
                    AVFile file=avObject.getAVFile("logo");
                    if(file!=null&&civ_user!=null){
                        Glide.with(getActivity()).load(file.getThumbnailUrl(true,120,120)).crossFade().into(civ_user);//改用缩略图
                    }
                   AVFile file1=avObject.getAVFile("blurBack");
                    if(file1!=null&&iv_back_blur!=null){
                        Glide.with(getActivity()).load(file1.getThumbnailUrl(true,480,320)).crossFade().into(iv_back_blur);
                    }

                }
            }
        });
        tv_name.setText(user.getUsername());
        tv_setting.setVisibility(View.VISIBLE);
        iv_setting.setVisibility(View.VISIBLE);

    }else {
        tv_name.setText("注册/登录");
        civ_user.setImageDrawable(getResources().getDrawable(R.drawable.iconfont_no_avatar2));
        tv_setting.setVisibility(View.GONE);
        iv_setting.setVisibility(View.GONE);
    }
}
 
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:37,代码来源:MeFragment.java


示例6: testDownload

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
private void testDownload() {
//        AVObject avObject = new AVObject("xXxX");
        AVQuery<AVObject> query = new AVQuery<>("xXxX");
        query.getInBackground("5753abe45bbb5000644026a8", new GetCallback<AVObject>() {
            @Override
            public void done(AVObject avObject, AVException e) {
                Log.d(TAG, avObject.toString());
            }
        });
    }
 
开发者ID:quekx,项目名称:MyShare,代码行数:11,代码来源:HomeActivity.java


示例7: updateUserInfo

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
public static void updateUserInfo() {
	AVUser user = AVUser.getCurrentUser();
	if (user != null) {
		user.fetchInBackground("friends", new GetCallback<AVObject>() {
			@Override
			public void done(AVObject avObject, AVException e) {
				if (e == null) {
					AVUser avUser = (AVUser) avObject;
					DemoApplication.registerUserCache(avUser);
				}
			}
		});
	}
}
 
开发者ID:lanixzcj,项目名称:LoveTalkClient,代码行数:15,代码来源:ChatUtils.java


示例8: updateUserInfo

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
public static void updateUserInfo() {
	AVUser user = AVUser.getCurrentUser();
	if (user != null) {
		user.fetchInBackground("friends", new GetCallback<AVObject>() {
			@Override
			public void done(AVObject avObject, AVException e) {
				if (e == null) {
					// User avUser = (User) avObject;
					// App.registerUserCache(avUser);
				}
			}
		});
	}
}
 
开发者ID:lanixzcj,项目名称:LoveTalkClient,代码行数:15,代码来源:Utils.java


示例9: getView

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
@Override
        public View getView(int position, View convertView, ViewGroup parent) {
            View v;
            final ViewHolder viewHolder;
            final AVObject item=comments.get(position);
            if(convertView==null){
                v= LayoutInflater.from(StoryActivity.this).inflate(R.layout.story_comment_item,null);
                viewHolder=new ViewHolder();
                viewHolder.iv_user= (ImageView) v.findViewById(R.id.iv_story_comment_user);
                viewHolder.tv_user= (TextView) v.findViewById(R.id.tv_story_comment_user);
                viewHolder.tv_time= (TextView) v.findViewById(R.id.tv_story_comment_time);
                viewHolder.tv_content= (TextView) v.findViewById(R.id.tv_story_comment_content);

                v.setTag(viewHolder);

            }else {
                v=convertView;
                viewHolder= (ViewHolder) v.getTag();
            }


            final AVUser avUser=item.getAVUser("user");
            if(avUser!=null){
                avUser.fetchInBackground(new GetCallback<AVObject>() {
                    @Override
                    public void done(AVObject avObject, AVException e) {
                        AVFile avFile = avUser.getAVFile("logo");
                        if(avFile!=null){
                            if(!StoryActivity.this.isDestroyed())
                                Glide.with(StoryActivity.this).load(avFile.getUrl()).crossFade().into(viewHolder.iv_user);
                        }else {
                            if(!StoryActivity.this.isDestroyed())
                                Glide.with(StoryActivity.this).load(R.drawable.logo).crossFade().into(viewHolder.iv_user);
                        }
                        viewHolder.tv_user.setText(avUser.getUsername());
                    }
                });
            }else {
                viewHolder.tv_user.setText("游客");
            }


            Date date=item.getDate("updatedAt");
//            String s=DateUtils.getRelativeTimeSpanString(StoryActivity.this, date.getTime()).toString();
            viewHolder.tv_time.setText(RelativeDateFormat.format(date));

            viewHolder.tv_content.setText(item.getString("content"));

            return v;
        }
 
开发者ID:JianxunRao,项目名称:FangYanShuo,代码行数:51,代码来源:StoryActivity.java


示例10: onBindViewHolder

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
@Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {

        final FriendViewHolder friendViewHolder = (FriendViewHolder) holder;

        String friendId = mData.get(position);

        Log.d(TAG, "friendId --> " + friendId);
        AVQuery<AVObject> query = new AVQuery<>(Constants.TABLE_NAME_USER);
        query.getInBackground(friendId, new GetCallback<AVObject>() {
            @Override
            public void done(AVObject object, AVException e) {

                String nickname = object.getString(Constants.KEY_NICKNAME);
                friendViewHolder.tvFriendName.setText(nickname);

//                AVObject head = object.getAVObject(Constants.KEY_HEAD_PHOTO);
                AVFile head = object.getAVFile(Constants.KEY_HEAD_PHOTO);
                String headUrl = null;
                if (head != null) {
                    headUrl = head.getUrl();
                }
                if (headUrl != null) {
                    String thumbnail = AVUtil.getThumbnail(headUrl, 60, null);
                    ImageUtil.loadImage(mContext, thumbnail, friendViewHolder.ivFriendHead);
//                    ImageUtil.loadImage(mContext, headUrl, friendViewHolder.ivFriendHead);
                } else {
                    friendViewHolder.ivFriendHead.setImageResource(R.drawable.photo_head);
                }

                Log.d(TAG, "nickname --> " + nickname);
            }
        });
//        query.whereStartsWith(Constants.KEY_OBJECT_ID, friendId);
//        query.findInBackground(new FindCallback<AVObject>() {
//            @Override
//            public void done(List<AVObject> list, AVException e) {
//                if (e == null && !list.isEmpty()) {
//                    AVObject object = list.get(0);
//
//                    AVObject head = object.getAVObject(Constants.KEY_HEAD_PHOTO);
//                    String headUrl = null;
//                    if (head != null) {
//                        headUrl = head.getString(Constants.KEY_URL);
//                    }
//
//                    String nickname = object.getString(Constants.KEY_NICKNAME);
//
//                    if (headUrl != null) {
//                        ImageUtil.loadImage(mContext, headUrl, friendViewHolder.ivFriendHead);
//                    } else {
//                        friendViewHolder.ivFriendHead.setImageResource(R.drawable.photo_head);
//                    }
//                    friendViewHolder.tvFriendName.setText(nickname);
//                    Log.d(TAG, "nickname --> " + nickname);
//                }
//            }
//        });
    }
 
开发者ID:quekx,项目名称:MyShare,代码行数:60,代码来源:FriendAdapter.java


示例11: fetchShotById

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
public static void fetchShotById(String objectId,GetCallback<AVObject> getCallback) {
  AVObject shot = AVObject.createWithoutData("Shot", objectId);
   shot.fetchInBackground(getCallback) ;
}
 
开发者ID:OldDriver007,项目名称:OldDriver-master,代码行数:5,代码来源:AVService.java


示例12: fetchAVUserById

import com.avos.avoscloud.GetCallback; //导入依赖的package包/类
public static void fetchAVUserById(String objectId,GetCallback<AVObject> getCallback) {
    AVObject user = AVObject.createWithoutData("AVUser", objectId);
    user.fetchInBackground(getCallback);
}
 
开发者ID:OldDriver007,项目名称:OldDriver-master,代码行数:5,代码来源:AVService.java



注:本文中的com.avos.avoscloud.GetCallback类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java NamespaceContextImpl类代码示例发布时间:2022-05-23
下一篇:
Java ITypeface类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap