@Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.btn_title_right:
        if (checkInputInfo()) {
          if (!findpwd_pwd1_ET.getText().toString().equals(findpwd_pwd_ET.getText().toString())) {
            Toast.makeText(getApplicationContext(), "两次输入密码不一致", Toast.LENGTH_SHORT).show();
            break;
          }

          loadingoverlay.setVisibility(View.VISIBLE);
          loadingoverlay.setLoadingTip("正在提交,请稍候...");
          startSubmitTask();

        } else {
          String errmsg = getErrorMsg();
          Toast.makeText(getApplicationContext(), errmsg, Toast.LENGTH_SHORT).show();
        }

        break;
      case R.id.btn_title_left:
        // 返回登录

        this.finish();
        break;
      default:
        break;
    }
  }
  private void startSubmitTask() {
    if (regBiz != null) regBiz.cancel();
    String pwdmd5 = Tools.getMD5Str(findpwd_pwd_ET.getText()).toUpperCase(Locale.US);
    regBiz =
        new FindPwdBiz(
            getApplicationContext(),
            new FindpwdHandler(FindPWDActivity_InputNewPWD.this),
            YtApplication.getInstance().getFindpwdPhone(),
            ACCOUTTYPE,
            pwdmd5);

    regBiz.execute();
  }
예제 #3
0
  @Override
  public void onClick(View v) {
    switch (v.getId()) {
      case R.id.registerTV:
        Intent intent1 = new Intent(getApplication(), RegisterActivity_Protocol.class);

        startActivity(intent1);

        break;
      case R.id.findpwdTV:
        Intent intent2 = new Intent(getApplication(), FindPWDActivity_InputPhone.class);

        startActivity(intent2);
        break;

      case R.id.loginButton:
        String userName = StringUtil.parseStr(userNameET.getText());
        String pwdmd5 = Tools.getMD5Str(passwordET.getText()).toUpperCase(Locale.US);
        String password = StringUtil.parseStr(pwdmd5);

        LoginInfoBean loginInfoBean = new LoginInfoBean();
        if (checkInputInfo(userName, password)) {

          loginInfoBean.setUsr_pwd(password);
          loginInfoBean.setUsr_account(userName.trim());
          // YtApplication.getInstance().setUserName(userName.trim());
          loadingoverlay.setVisibility(View.VISIBLE);
          loadingoverlay.setLoadingTip("正在登录,请稍候...");
          startLoginTask(loginInfoBean);

        } else {
          String errmsg = getErrorMsg();
          Toast.makeText(getApplicationContext(), errmsg, Toast.LENGTH_SHORT).show();
        }
        break;
      default:
    }
  }