在注册时调用方法
EMChatManager.getInstance().createAccountOnServer(username, pwd);
时铺到了异常
Toast.makeText(getApplicationContext(), "注册失败: " + e.getMessage()+"/"+errorCode, Toast.LENGTH_SHORT).show()
注册方法
/**
* 注册
*
* @param view
*/
public void register(View view) {
final String username = userNameEditText.getText().toString().trim();
final String pwd = passwordEditText.getText().toString().trim();
String confirm_pwd = confirmPwdEditText.getText().toString().trim();
if (TextUtils.isEmpty(username)) {
Toast.makeText(this, "用户名不能为空!", Toast.LENGTH_SHORT).show();
userNameEditText.requestFocus();
return;
} else if (TextUtils.isEmpty(pwd)) {
Toast.makeText(this, "密码不能为空!", Toast.LENGTH_SHORT).show();
passwordEditText.requestFocus();
return;
} else if (TextUtils.isEmpty(confirm_pwd)) {
Toast.makeText(this, "确认密码不能为空!", Toast.LENGTH_SHORT).show();
confirmPwdEditText.requestFocus();
return;
} else if (!pwd.equals(confirm_pwd)) {
Toast.makeText(this, "两次输入的密码不一致,请重新输入!", Toast.LENGTH_SHORT).show();
return;
}
if (!TextUtils.isEmpty(username) && !TextUtils.isEmpty(pwd))