zoukankan      html  css  js  c++  java
  • 团队冲刺

    第六天

    完善了修改密码的页面

    并且可以发验证码注册了

    每天上限20条验证码

    Button btn_change_password_ok = findViewById(R.id.btn_change_password_ok);
    btn_change_password_ok.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    EditText oldpassword=findViewById(R.id.et_oldpassword);
    EditText newpassword=findViewById(R.id.et_newpassword);
    if(!oldpassword.getText().toString().equals("")&&!newpassword.getText().toString().equals("")
    &&newpassword.getText().toString().length()>=6){
    BmobQuery<Bean> b = new BmobQuery<>();
    b.addWhereEqualTo("Phone",phone);
    b.findObjects(new FindListener<Bean>() {
    @Override
    public void done(List<Bean> list, BmobException e) {
    if(e == null){
    if(list.size()>0){
    if(oldpassword.getText().toString().equals(list.get(0).Password)){
    Bean bean = new Bean();
    bean.Password=newpassword.getText().toString();
    bean.State="F";
    bean.update(id, new UpdateListener() {
    @Override
    public void done(BmobException e) {
    if(e==null){
    Toast.makeText(ChangePassword.this,"修改成功,请重新登录!",Toast.LENGTH_SHORT).show();
    Intent intent = new Intent(ChangePassword.this, Login.class);
    startActivity(intent);
    finish();
    }
    }
    });
    }else
    Toast.makeText(ChangePassword.this,"原密码错误!",Toast.LENGTH_SHORT).show();
    }
    }
    }
    });
    }else {
    Toast.makeText(ChangePassword.this,"原密码或新密码填写错误!",Toast.LENGTH_SHORT).show();
  • 相关阅读:
    训练1-J
    训练1-K
    训练1-P
    二分查找法详解
    POJ:1094-Sorting It All Out(拓扑排序经典题型)
    POJ:2632-Crashing Robots
    POJ:1086-Parencodings
    POJ:2586-Y2K Accounting Bug
    POJ:2109-Power of Cryptography(关于double的误差)
    POJ:1328-Radar Installation
  • 原文地址:https://www.cnblogs.com/D10304/p/14914124.html
Copyright © 2011-2022 走看看