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


Java SaveListener類代碼示例

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


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

示例1: registerData

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
/**
 * 注冊
 */
private void registerData() {

    final String name = etusername.getText().toString();
    final String password = etpassword.getText().toString();
    final String email = etemail.getText().toString();
    BmobUser bu = new BmobUser();
    bu.setUsername(name);
    bu.setPassword(password);
    bu.setEmail(email);
    bu.signUp(new SaveListener<BmobUser>() {
        @Override
        public void done(BmobUser bmobUser, BmobException e) {
            if(e==null){
                Toast.makeText(RegisterActivity.this, "注冊成功", Toast.LENGTH_SHORT).show();
                RegisterActivity.this.finish();
            }else{
                Toast.makeText(RegisterActivity.this, "注冊失敗", Toast.LENGTH_SHORT).show();
            }}
    });
}
 
開發者ID:chenlindev,項目名稱:beyondwords,代碼行數:24,代碼來源:RegisterActivity.java

示例2: saveFeedbackMsg

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
/**
    * 保存反饋信息到服務器
    * @param msg 反饋信息
    */
   private void saveFeedbackMsg(String msg)
   {
xp feedback = new xp();
feedback.setContent(msg);
feedback.save(this, new SaveListener() {

	@Override
	public void onSuccess()
	{
	}

	@Override
	public void onFailure(int code, String arg0)
	{
	}
    });
   }
 
開發者ID:stytooldex,項目名稱:stynico,代碼行數:22,代碼來源:SkinEngine.java

示例3: addUserHasSign

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
public void addUserHasSign(final UserHasSigned userHasSigned) {
	userHasSigned.save(new SaveListener<String>() {
		@Override
		public void done(String s, BmobException e) {
			if (e == null) {
				Log.i(TAG, "userHasSigned.save: success");
				DatabaseAdapter db = new DatabaseAdapter(context);
				userHasSigned.setObjectId(s);
				db.addUser_User(userHasSigned, myHandler);
				Log.i(TAG, "addUser_User: Success!");
			} else {
				Log.e(TAG, "userHasSigned.save: failed" + e);
				Message message = new Message();
				message.arg1 = FinalUtil.DETECT_FAILED_IO_EXCEPTION;
				myHandler.sendMessage(message);
			}
		}
	});
}
 
開發者ID:tony-Shx,項目名稱:Swface,代碼行數:20,代碼來源:BmobDataHelper.java

示例4: uploadChatTableMessage

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
private void uploadChatTableMessage(final GroupTableMessage groupTableMessage, SaveListener listener) {
        List<String> groupNumber = groupTableMessage.getGroupNumber();
        GroupTableMessage message;
        List<String> copy = new ArrayList<>(groupNumber);
        if (copy.contains(UserManager.getInstance().getCurrentUserObjectId())) {
                copy.remove(UserManager.getInstance().getCurrentUserObjectId());
        }
        List<BmobObject> groupTableMessageList = new ArrayList<>();
        for (int i = 0; i < copy.size(); i++) {
                message = new GroupTableMessage();
                message.setSendStatus(Constant.SEND_STATUS_SUCCESS);
                message.setReadStatus(Constant.READ_STATUS_UNREAD);
                message.setGroupDescription(groupTableMessage.getGroupDescription());
                message.setGroupId(groupTableMessage.getGroupId());
                message.setCreatedTime(groupTableMessage.getCreatedTime());
                message.setToId(copy.get(i));
                message.setGroupNumber(groupNumber);
                message.setGroupAvatar(groupTableMessage.getGroupAvatar());
                message.setGroupName(groupTableMessage.getGroupName());
                message.setGroupNick(groupTableMessage.getGroupNick());
                message.setNotification(groupTableMessage.getNotification());
                message.setCreatorId(groupTableMessage.getCreatorId());
                groupTableMessageList.add(message);
        }
        new BmobObject().insertBatch(CustomApplication.getInstance(), groupTableMessageList, listener);
}
 
開發者ID:HelloChenJinJun,項目名稱:TestChat,代碼行數:27,代碼來源:MsgManager.java

示例5: registe

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
public void registe(final String name, final String password, final String phone, final String email) {
    ThreadUtils.runOnSubthread(new Runnable() {
        @Override
        public void run() {
            final UserInfo info = new UserInfo();
            info.setUsername(name);
            info.setPassword(password);
            info.setEmail(email);
            info.setPhoneNumber(phone);
            info.save(new SaveListener<String>() {
                @Override
                public void done(String s, BmobException e) {
                    if (e == null) {
                        //注冊成功
                        iRegisterView.registerSucc();
                    } else {
                        //注冊失敗
                        iRegisterView.registerFail(e.getMessage());
                    }
                }
            });
        }
    });

}
 
開發者ID:ITBlackDog,項目名稱:XiaoHuaCharge,代碼行數:26,代碼來源:RegisterPrecenter.java

示例6: sendComment

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
private void sendComment() {
        String content = etComment.getText().toString();
        if (TextUtils.isEmpty(content)) {
            showToast("評論內容不能為空");
            return;
        }
        Comment comment = new Comment();
        comment.setContent(content);
        comment.setUser(BmobUser.getCurrentUser(User.class));
        comment.setArticle(article);
        comment.setLikeNum(new Integer(0));
        comment.save(new SaveListener<String>() {
            @Override
            public void done(String s, BmobException e) {
                if (e == null) {
//                    發送成功後,對話框直接消失
                    popupWindow.dismiss();
                } else {
                    showToast("評論上傳失敗" + e.getMessage() + e.getErrorCode());
                }
            }
        });
    }
 
開發者ID:HowieTianDev,項目名稱:ChenYan,代碼行數:24,代碼來源:ArticleDetailActivity.java

示例7: sendComment

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
private void sendComment() {
        String content = etComment.getText().toString();
        if (TextUtils.isEmpty(content)) {
            showToast("評論內容不能為空");
            return;
        }
        Comment comment = new Comment();
        comment.setContent(content);
        comment.setUser(BmobUser.getCurrentUser(User.class));
        comment.setmActivity(mactivity);
        comment.setLikeNum(new Integer(0));
        comment.save(new SaveListener<String>() {
            @Override
            public void done(String s, BmobException e) {
                if (e == null) {
//                    發送成功後,對話框直接消失
                    popupWindow.dismiss();
                } else {
                    showToast("評論上傳失敗" + e.getMessage() + e.getErrorCode());
                }
            }
        });
    }
 
開發者ID:HowieTianDev,項目名稱:ChenYan,代碼行數:24,代碼來源:ActivityDetailActivity.java

示例8: sendFeedback

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
@Override
public void sendFeedback(final String content, final String contact) {

    if(TextUtils.isEmpty(content)){
        ToastUtils.showShort("請至少填寫反饋內容");
        return;
    }
    if(content.equals(mLastContent) && contact.equals(mLastContact)){
        ToastUtils.showShort("請不要重複提交");
        return;
    }

    Feedback feedback=getFeedback(content,contact);
    mView.showLoading();
    feedback.save(new SaveListener<String>() {
        @Override
        public void done(String s, BmobException e) {
           sendBack(e,content,contact);
        }
    });
}
 
開發者ID:ifadai,項目名稱:SuperNote,代碼行數:22,代碼來源:FeedbackPresenter.java

示例9: saveDate

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
private void saveDate(AccountBean accountBean) {
    accountBean.save(new SaveListener<String>() {
        @Override
        public void done(String objectId, BmobException e) {
            if (e == null) {
                MyApplication.showToast("保存成功");
                SPUtils.removeDataList("beans");
                AppManager.getAppManager().finishActivity(MainActivity.class);
                Intent intent = new Intent(AddActivity.this, MainActivity.class);
                startActivity(intent);
                finish();
            } else {
                MyApplication.showToast("保存失敗" + e.getMessage());
            }
            pDialog.dismiss();
        }
    });
}
 
開發者ID:paradoxie,項目名稱:DizzyPassword,代碼行數:19,代碼來源:AddActivity.java

示例10: addComment

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
/**
 * 添加評論
 */
public void addComment(Post post, String content, final RequestListener<String> listener) {
    if (!checkNet(listener)) return;
    if (!checkLoginStatus(listener)) return;
    User user = BmobUser.getCurrentUser(User.class);
    final Comment comment = new Comment();
    comment.setContent(content);
    comment.setPost(post);
    comment.setUser(user);
    comment.save(new SaveListener<String>() {

        @Override
        public void done(String objectId, BmobException e) {
            if (e == null) {
                listener.success(AppController.getAppContext().getString(R.string.add_comment_success));
            } else {
                listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
            }
        }

    });
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:25,代碼來源:NetRequest.java

示例11: replyComment

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
/**
 * 回複評論
 */
public void replyComment(User replyUser, Comment comment, String content, final RequestListener listener) {
    if (!checkNet(listener)) return;
    if (!checkLoginStatus(listener)) return;
    Reply reply = new Reply();
    reply.setSpeakUser(BmobUser.getCurrentUser(User.class));
    reply.setComment(comment);
    reply.setContent(content);
    reply.setReplyUser(replyUser);
    reply.save(new SaveListener<String>() {
        @Override
        public void done(String s, BmobException e) {
            if (e == null) {
                listener.success(null);
            } else {
                listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
            }
        }
    });
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:23,代碼來源:NetRequest.java

示例12: uploadArticle

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
/**
 * 上傳發表帖子
 *
 * @param coverPicture
 * @param title
 * @param article
 */
public void uploadArticle(String coverPicture, String title, String article, final RequestListener<String> listener) {
    if (!checkNet(listener)) return;
    if (!checkLoginStatus(listener)) return;
    User user = BmobUser.getCurrentUser(User.class);
    if (user == null) {
        listener.error(AppController.getAppContext().getString(R.string.please_login));
        return;
    }
    Post post = new Post();
    post.setContent(article);
    post.setTitle(title);
    post.setCoverPicture(coverPicture);
    post.setAuthor(user);
    post.save(new SaveListener<String>() {

        @Override
        public void done(String s, BmobException e) {
            if (e == null) {
                listener.success(s);
            } else {
                listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
            }
        }
    });
}
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:33,代碼來源:NetRequest.java

示例13: saveArticle

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
/**
     * 保存文章
     *
     * @param coverPicture
     * @param title
     * @param article
     */
    public void saveArticle(String coverPicture, String title, String article, final RequestListener<String> listener) {
        if (!checkNet(listener)) return;
        if (!checkLoginStatus(listener)) return;
        User user = BmobUser.getCurrentUser(User.class);
        if (user == null) {
            listener.error(AppController.getAppContext().getString(R.string.please_login));
            return;
        }
        Post note = new Post();
        note.setContent(article);
        note.setTitle(title);
//        note.setCoverPicture(coverPicture);
        note.setAuthor(user);
        note.save(new SaveListener<String>() {

            @Override
            public void done(String s, BmobException e) {
                if (e == null) {
                    listener.success(s);
                } else {
                    listener.error(ErrMsgFactory.errMSG(e.getErrorCode()));
                }
            }
        });
    }
 
開發者ID:weimin96,項目名稱:shareNote,代碼行數:33,代碼來源:NetRequest.java

示例14: saveDatial

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
private void saveDatial() {
    mData.setMyUser(mMyUser);
    mData.setCarNub(mTvCarnub.getText().toString());
    mData.setDesc(mEtBikeDamage.getText().toString());
    mData.setCarPic(bmobFile);
    mData.setType(mAdapter.getType());
    mData.save(new SaveListener<String>() {
        @Override
        public void done(String s, BmobException e) {
            if (e == null) {
                ToastUtils.show(BikeDamageReportActivity.this, "提交成功");
                finish();
            } else {

                Logger.d(e);
                ToastUtils.show(BikeDamageReportActivity.this, "提交失敗");
            }
            mBtQuery.setClickable(true);
            if (mDialog.isShowing())
                mDialog.dismiss();
        }
    });
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:24,代碼來源:BikeDamageReportActivity.java

示例15: saveDatial

import cn.bmob.v3.listener.SaveListener; //導入依賴的package包/類
private void saveDatial() {
    mData.setMyUser(mMyUser);
    mData.setCarNub(mTvCarnub.getText().toString());
    mData.setDesc(mEtBikeDamage.getText().toString());
    mData.setCarPic(bmobFile);
    mData.setType("舉報違停");
    mData.save(new SaveListener<String>() {
        @Override
        public void done(String s, BmobException e) {
            if (e == null) {
                ToastUtils.show(ReportViolationsActivity.this, "提交成功");
                finish();
            } else {
                ToastUtils.show(ReportViolationsActivity.this, "提交失敗");
            }
            if (mDialog.isShowing())
                mDialog.dismiss();
        }
    });
}
 
開發者ID:yiwent,項目名稱:Mobike,代碼行數:21,代碼來源:ReportViolationsActivity.java


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