當前位置: 首頁>>代碼示例>>Java>>正文


Java UpdateListener類代碼示例

本文整理匯總了Java中cn.bmob.v3.listener.UpdateListener的典型用法代碼示例。如果您正苦於以下問題:Java UpdateListener類的具體用法?Java UpdateListener怎麽用?Java UpdateListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


UpdateListener類屬於cn.bmob.v3.listener包,在下文中一共展示了UpdateListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: deleteUserFace

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void deleteUserFace(final String object, final String faceToken, final String faceUrl){
	UserHasSigned userHasSigned = new UserHasSigned(context);
	userHasSigned.setObjectId(object);
	userHasSigned.remove(faceToken);
	userHasSigned.remove(faceUrl);
	userHasSigned.update(new UpdateListener() {
		@Override
		public void done(BmobException e) {
			if(e==null){
				DatabaseAdapter db = new DatabaseAdapter(context);
				db.deleteUserFace_User(object,faceToken,faceUrl,myHandler);
			}else{
				Log.e(TAG, "deleteUserFace: ", e);
				Message message = Message.obtain();
				message.arg1 = FinalUtil.REMOVE_FACE_BMOB_EXCEPTION;
				myHandler.sendMessage(message);
			}
		}
	});

}
 
開發者ID:tony-Shx,項目名稱:Swface,代碼行數:22,代碼來源:BmobDataHelper.java

示例2: deleteUser

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void deleteUser(final String objectId){
	UserHasSigned userHasSigned = new UserHasSigned(context);
	userHasSigned.setObjectId(objectId);
	userHasSigned.delete(new UpdateListener() {
		@Override
		public void done(BmobException e) {
			if(e==null){
				DatabaseAdapter db = new DatabaseAdapter(context);
				db.deleteUser_User(objectId,myHandler);
			}else{
				Log.e(TAG, "userHasSigned.delete: ", e);
				Message message = Message.obtain();
				message.arg1 = FinalUtil.REMOVE_USER_BMOB_EXCEPTION;
				myHandler.sendMessage(message);
			}
		}
	});
}
 
開發者ID:tony-Shx,項目名稱:Swface,代碼行數:19,代碼來源:BmobDataHelper.java

示例3: saveNewFriendToServer

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
/**
         * 在服務器上關聯該好友
         *
         * @param user           用戶實體
         * @param currentId      現在的登錄用戶ID
         * @param updateListener 跟新回調
         */
        private void saveNewFriendToServer(User user, String currentId, UpdateListener updateListener) {
                if (getCurrentUser() != null && currentId.equals(getCurrentUserObjectId())) {
                        User currentUser = new User();
                        currentUser.setObjectId(currentId);
                        BmobRelation relation = new BmobRelation();
                        relation.add(user);
                        currentUser.setContacts(relation);
                        currentUser.update(CustomApplication.getInstance(), updateListener
                        );
                } else {
                        LogUtil.e("toId:" + currentId);
                        if (getCurrentUser() != null) {
                                LogUtil.e("現在的UID:" + getCurrentUserObjectId());
                        }
//                        不是當前用戶的情況下
                        LogUtil.e("不是當前的用戶,不在服務器上關聯該好友");
                        updateListener.onFailure(0, "不是當前的用戶,不在服務器上關聯該好友");
                }
        }
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:27,代碼來源:UserManager.java

示例4: addToBlack

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
/**
         * 添加為黑名單
         *
         * @param user                     用戶實體
         * @param addBlackCallBackListener 回調
         */
        public void addToBlack(final User user, final AddBlackCallBackListener addBlackCallBackListener) {
                addBlackRelation(user, new UpdateListener() {
                                @Override
                                public void onSuccess() {
                                        long result1 = updateFriendBlackStatus(user.getUsername(), true);
                                        long result2 = ChatDB.create().deleteRecentMsg(user.getObjectId());
                                        if (result1 > 0 && result2 > 0) {
                                                addBlackCallBackListener.onSuccess(user);
                                        } else {
                                                addBlackCallBackListener.onFailed(new BmobException("在數據庫更新用戶黑名單狀態失敗或者是刪除最近會話失敗"));
                                        }
//                                        LogUtil.e("在服務器上關聯該用戶為黑名單失敗");
                                }

                                @Override
                                public void onFailure(int i, String s) {
                                        LogUtil.e("在服務器上關聯該用戶為黑名單失敗");
                                        addBlackCallBackListener.onFailed(new BmobException(s));
                                }
                        }
                );


        }
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:31,代碼來源:UserManager.java

示例5: cancelBlack

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
/**
 * 取消黑名單回調
 *
 * @param user     用戶實體
 * @param listener 回調
 */
public void cancelBlack(final User user, final CancelBlackCallBlackListener listener) {
        deleteBlackRelation(user, new UpdateListener() {
                        @Override
                        public void onSuccess() {
                                long result = updateFriendBlackStatus(user.getUsername(), false);
                                if (result > 0) {
                                        listener.onSuccess(user);
                                } else {
                                        listener.onFailed(new BmobException("在數據庫中更新黑名單狀態失敗"));
                                }
                        }

                        @Override
                        public void onFailure(int i, String s) {
                                listener.onFailed(new BmobException(s));
                        }
                }
        );
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:26,代碼來源:UserManager.java

示例6: addLiker

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void addLiker(final String id, final DealMessageCallBack dealMessageCallBack) {
        final SharedMessage sharedMessage = ChatDB.create().getSharedMessage(id);
        sharedMessage.getLikerList().add(UserManager.getInstance().getCurrentUserObjectId());
        sharedMessage.update(CustomApplication.getInstance(), new UpdateListener() {
                @Override
                public void onSuccess() {
                        ChatDB.create().saveSharedMessage(sharedMessage);
                        dealMessageCallBack.onSuccess(sharedMessage.getObjectId());
                }

                @Override
                public void onFailure(int i, String s) {
                        dealMessageCallBack.onFailed(sharedMessage.getObjectId(), i, s);
                }
        });
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:17,代碼來源:MsgManager.java

示例7: deleteLiker

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void deleteLiker(final String id, final DealMessageCallBack dealMessageCallBack) {
        final SharedMessage sharedMessage = ChatDB.create().getSharedMessage(id);
        if (sharedMessage.getLikerList().contains(UserManager.getInstance().getCurrentUserObjectId())) {
                sharedMessage.getLikerList().remove(UserManager.getInstance().getCurrentUserObjectId());
                LogUtil.e("刪除點讚消息成功");
        }
        sharedMessage.update(CustomApplication.getInstance(), new UpdateListener() {
                @Override
                public void onSuccess() {
                        LogUtil.e("更新服務器上刪除點讚消息成功");
                        ChatDB.create().saveSharedMessage(sharedMessage);
                        dealMessageCallBack.onSuccess(sharedMessage.getObjectId());
                }

                @Override
                public void onFailure(int i, String s) {
                        LogUtil.e("更新服務器上刪除點讚消息失敗");
                        dealMessageCallBack.onFailed(sharedMessage.getObjectId(), i, s);
                }
        });
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:22,代碼來源:MsgManager.java

示例8: deleteComment

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void deleteComment(final String id, final int position, final DealCommentMsgCallBack dealCommentMsgCallBack) {
//                這裏先進行說說主題的解綁操作
                final SharedMessage sharedMessage = ChatDB.create().getSharedMessage(id);
                if (sharedMessage.getCommentMsgList().size() > position) {
                        final String commentMsg = sharedMessage.getCommentMsgList().remove(position);
                        LogUtil.e("11將要刪除的評論消息:" + commentMsg);
                        sharedMessage.update(CustomApplication.getInstance(), new UpdateListener() {
                                @Override
                                public void onSuccess() {
                                        LogUtil.e("在服務器上更新刪除評論成功");
                                        ChatDB.create().saveSharedMessage(sharedMessage);
                                        dealCommentMsgCallBack.onSuccess(sharedMessage.getObjectId(), commentMsg, position);
                                }

                                @Override
                                public void onFailure(int i, String s) {
                                        LogUtil.e("在服務器上更新刪除評論失敗" + s + i);
                                        dealCommentMsgCallBack.onFailed(sharedMessage.getObjectId(), commentMsg, position, i, s);
                                }
                        });
                }
        }
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:23,代碼來源:MsgManager.java

示例9: updateUserAvatar

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void updateUserAvatar(final String uid, final String avatar, final DealUserInfoCallBack dealUserInfoCallBack) {
        User user = new User();
        user.setObjectId(uid);
        user.setAvatar(avatar);
        user.update(CustomApplication.getInstance(), new UpdateListener() {
                @Override
                public void onSuccess() {
                        LogUtil.e("在服務器上更新用戶頭像成功");
                        dealUserInfoCallBack.updateAvatarSuccess(uid, avatar);
                }

                @Override
                public void onFailure(int i, String s) {
                        LogUtil.e("在服務器上更新用戶頭像失敗");
                        dealUserInfoCallBack.onFailed(uid, i, s);
                }
        });

}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:20,代碼來源:MsgManager.java

示例10: updateUserSignature

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void updateUserSignature(final String uid, final String signature, final DealUserInfoCallBack dealUserInfoCallBack) {
        User user = new User();
        user.setSignature(signature);
        user.setObjectId(uid);
        user.update(CustomApplication.getInstance(), new UpdateListener() {
                @Override
                public void onSuccess() {
                        LogUtil.e("在服務器上更新用戶簽名成功");
                        dealUserInfoCallBack.updateSignatureSuccess(uid, signature);
                }

                @Override
                public void onFailure(int i, String s) {
                        LogUtil.e("在服務器上更新用戶簽名失敗");
                        dealUserInfoCallBack.onFailed(uid, i, s);
                }
        });
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:19,代碼來源:MsgManager.java

示例11: updateUserNick

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
public void updateUserNick(final String uid, final String nick, final DealUserInfoCallBack dealUserInfoCallBack) {
        User user = new User();
        user.setNick(nick);
        user.setObjectId(uid);
        user.update(CustomApplication.getInstance(), new UpdateListener() {
                @Override
                public void onSuccess() {
                        LogUtil.e("在服務器上更新用戶昵稱成功");
                        dealUserInfoCallBack.updateNickSuccess(uid, nick);
                }

                @Override
                public void onFailure(int i, String s) {
                        LogUtil.e("在服務器上更新用戶昵稱失敗");
                        dealUserInfoCallBack.onFailed(uid, i, s);
                }
        });
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:19,代碼來源:MsgManager.java

示例12: onClick

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
@Override
public void onClick(View v) {
        switch (v.getId()) {
                case R.id.btn_group_number_info_detail_exit:
                        if (!CommonUtils.isNetWorkAvailable()) {
                                ToastUtils.showShortToast("網絡連接失敗,請檢查網絡配置");
                                return;
                        }
                        final String deleteId = mGroupNumberInfo.getUser().getObjectId();
                        MsgManager.getInstance().updateGroupMessage(groupId, "deleteNumber", deleteId, new UpdateListener() {
                                @Override
                                public void onSuccess() {
                                        LogUtil.e("1刪除群成員成功");
                                }

                                @Override
                                public void onFailure(int i, String s) {
                                        LogUtil.e("刪除群成員失敗" + s + i);
                                }
                        });
                        break;
        }
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:24,代碼來源:GroupNumberInfoDetailActivity.java

示例13: refreshData

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
/**
  * 刷新數據操作
  */
 private void refreshData(List<KeepInfo> mDatas){

     MyUser bmobUser=BmobUser.getCurrentUser(MyUser.class);

     if (bmobUser!=null){
         MyUser newUser=new MyUser();
newUser.setValue("keep",mDatas);

         newUser.update(bmobUser.getObjectId(), new UpdateListener() {
             @Override
             public void done(BmobException e) {

                 if (e==null){

                     Toast.makeText(UIUtils.getContext(),"刪除成功",Toast.LENGTH_SHORT).show();
                 }else {
                     Toast.makeText(UIUtils.getContext(),"刪除失敗 請重試",Toast.LENGTH_SHORT).show();
                 }
             }
         });
     }
 }
 
開發者ID:android-jian,項目名稱:topnews,代碼行數:26,代碼來源:KeepOneFragment.java

示例14: toCollect

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
private void toCollect() {
        BmobRelation relation = new BmobRelation();
//        將當前用戶添加到MActivity表中的collect字段中,表名當前用戶收藏了該活動內容
        relation.add(BmobUser.getCurrentUser(User.class));
        article.setCollect(relation);

        if (article.getCollectIdList() != null) {
            collectIdList = article.getCollectIdList();
        }
        collectIdList.add(user.getObjectId());
        article.setCollectIdList(collectIdList);
        article.update(new UpdateListener() {
            @Override
            public void done(BmobException e) {
                if (e == null) {
                    Log.e(TAG, "收藏成功");

                    ivCollect.setImageResource(R.drawable.ic_favorite_orange_500_24dp);
                    isCollect = true;
                } else {
                    Log.e(TAG, "收藏失敗" + e.getMessage() + e.getErrorCode());
                }
            }
        });

    }
 
開發者ID:HowieTianDev,項目名稱:ChenYan,代碼行數:27,代碼來源:ArticleDetailActivity.java

示例15: cancelCollect

import cn.bmob.v3.listener.UpdateListener; //導入依賴的package包/類
private void cancelCollect() {
    BmobRelation relation = new BmobRelation();
    relation.remove(BmobUser.getCurrentUser(User.class));
    article.setCollect(relation);
    //                    移除當前用戶的收藏ID
    if (article.getCollectIdList() != null) {
        collectIdList = article.getCollectIdList();
    }
    collectIdList.remove(user.getObjectId());
    article.setCollectIdList(collectIdList);
    article.update(new UpdateListener() {
        @Override
        public void done(BmobException e) {
            if (e == null) {
                Log.e(TAG, "取消收藏成功");


                ivCollect.setImageResource(R.drawable.ic_favorite_border_grey_500_24dp);
                isCollect = false;

            } else {
                Log.e(TAG, "取消收藏失敗" + e.getErrorCode() + e.getMessage());
            }
        }
    });
}
 
開發者ID:HowieTianDev,項目名稱:ChenYan,代碼行數:27,代碼來源:ArticleDetailActivity.java


注:本文中的cn.bmob.v3.listener.UpdateListener類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。