本文整理匯總了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();
}}
});
}
示例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)
{
}
});
}
示例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);
}
}
});
}
示例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);
}
示例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());
}
}
});
}
});
}
示例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());
}
}
});
}
示例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());
}
}
});
}
示例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);
}
});
}
示例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();
}
});
}
示例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()));
}
}
});
}
示例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()));
}
}
});
}
示例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()));
}
}
});
}
示例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()));
}
}
});
}
示例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();
}
});
}
示例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();
}
});
}