本文整理汇总了Java中cn.bmob.v3.BmobUser.setPassword方法的典型用法代码示例。如果您正苦于以下问题:Java BmobUser.setPassword方法的具体用法?Java BmobUser.setPassword怎么用?Java BmobUser.setPassword使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.bmob.v3.BmobUser
的用法示例。
在下文中一共展示了BmobUser.setPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerData
import cn.bmob.v3.BmobUser; //导入方法依赖的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: registerBmob
import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void registerBmob(String userName,String passWord){
BmobUser bu = new BmobUser();
bu.setUsername(userName);
bu.setPassword(passWord);
bu.signUp(new SaveListener<BmobUser>() {
@Override
public void done(BmobUser s, BmobException e) {
if(e==null){
Toast.makeText(LoginActivity.this, "注册成功:" +s.toString(), Toast.LENGTH_LONG).show();
}else{
Log.i("bmob","注册失败:"+e.getMessage()+","+e.getErrorCode());
}
}
});
}
示例3: loginBmob
import cn.bmob.v3.BmobUser; //导入方法依赖的package包/类
private void loginBmob(){
final String account=accountNum.getText().toString();
final String psword= psw.getText().toString();
if(account.length()==0 || psword.length()==0){//当账号或密码的输入为空时提示
Toast.makeText(this, "请输入账号密码", Toast.LENGTH_SHORT).show();
return;
}
BmobUser bu = new BmobUser();
bu.setUsername(account);
bu.setPassword(psword);
bu.login(new SaveListener<BmobUser>() {
@Override
public void done(BmobUser s, BmobException e) {
if(e==null){
Toast.makeText(LoginActivity.this, "登陆成功" , Toast.LENGTH_LONG).show();
editor=pref.edit();
if(checkBox.isChecked()){
editor.putBoolean("remember_password",true);
editor.putString("account",account);
editor.putString("password",psword);
}else {
editor.clear();}
editor.apply();
Intent intent = new Intent(LoginActivity.this,MainActivity.class);
startActivity(intent);
finish();
}else{
if(e.getErrorCode()==9016){
Toast.makeText(LoginActivity.this, "网络不可用,请检查你的网络连接", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(LoginActivity.this,"账号或密码错误(password or account is not valid)",Toast.LENGTH_LONG).show();
}
Log.i("bmob","登陆失败:"+e.getMessage()+","+e.getErrorCode());
}
}
});
}