コード例 #1
0
  public void resgisteringUserData(View v) {
    String value_name = name.getText().toString();
    String value_email_id = email_id.getText().toString();
    String value_mobile_no = mobile_no.getText().toString();
    String value_username = username.getText().toString();
    String value_password = password.getText().toString();
    String value_confirm_password = confirm_password.getText().toString();

    if (ReuseableClass.haveNetworkConnection(RegisterActivity.this)) {
      if (value_name.trim().equalsIgnoreCase("")
          || value_email_id.trim().equalsIgnoreCase("")
          || value_mobile_no.trim().equalsIgnoreCase("")
          || value_username.trim().equalsIgnoreCase("")
          || value_password.trim().equalsIgnoreCase("")
          || value_confirm_password.trim().equalsIgnoreCase("")) {
        Toast.makeText(this, R.string.all_field_mandatory, Toast.LENGTH_SHORT).show();
      } else {
        if (value_password.equalsIgnoreCase(value_confirm_password)) {
          dialog = new ProgressDialog(RegisterActivity.this);
          dialog.setMessage(RegisterActivity.this.getString(R.string.wait_a_min_dialog_message));
          dialog.show();

          new UserRegistrationTask()
              .execute(value_name, value_email_id, value_mobile_no, value_username, value_password);
        } else {
          Toast.makeText(this, R.string.password_missmatch_error, Toast.LENGTH_SHORT).show();
        }
      }
    } else {
      Toast.makeText(this, R.string.check_network, Toast.LENGTH_SHORT).show();
    }
  }