Пример #1
0
  private boolean checkInput() {

    if (StringUtils.isEmpty(et_telNo.getText().toString().trim())) {
      Toast.makeText(RegisteredActivity.this, "用户手机号不能为空", Toast.LENGTH_SHORT).show();
      return false;
    }
    if (!Utils.checkPhoneNum(et_telNo.getText().toString())) {
      Toast.makeText(this, "手机号不合法", Toast.LENGTH_SHORT).show();
      return false;
    }
    if (StringUtils.isEmpty(et_valNo.getText().toString().trim())) {
      Toast.makeText(RegisteredActivity.this, "用户验证码不能为空", Toast.LENGTH_SHORT).show();
      return false;
    }
    if (StringUtils.isEmpty(et_pwds.getText().toString().trim())) {
      Toast.makeText(RegisteredActivity.this, "用户密码不能为空", Toast.LENGTH_SHORT).show();
      return false;
    }
    if (StringUtils.isEmpty(et_pwd_again.getText().toString().trim())) {
      Toast.makeText(RegisteredActivity.this, "用户确认密码不能为空", Toast.LENGTH_SHORT).show();
      return false;
    }
    if (!et_pwds.getText().toString().trim().equals(et_pwd_again.getText().toString().trim())) {
      Toast.makeText(RegisteredActivity.this, "密码与确认密码不一致", Toast.LENGTH_SHORT).show();
      return false;
    }
    return true;
  }
Пример #2
0
  @OnClick(R.id.tv_getVal)
  public void getVal() {

    if (StringUtils.isEmpty(et_telNo.getText().toString().trim())) {
      Toast.makeText(RegisteredActivity.this, "用户手机号不能为空", Toast.LENGTH_SHORT).show();
    } else {
      if (!Utils.checkPhoneNum(et_telNo.getText().toString())) {
        Toast.makeText(this, "手机号不合法", Toast.LENGTH_SHORT).show();
      } else {

        getValFromServer();
      }
    }
  }