@Override public void onClick(View v) { // TODO Auto-generated method stub switch (v.getId()) { case R.id.btn_register: if (TextUtils.isEmpty(mEtUserName.getText().toString().trim())) { mEtUserName.setShakeAnimation(); Toast.makeText(mContext, "请输入用户名", Toast.LENGTH_SHORT).show(); return; } if (TextUtils.isEmpty(mEtPassword.getText().toString().trim())) { mEtPassword.setShakeAnimation(); Toast.makeText(mContext, "请输入密码", Toast.LENGTH_SHORT).show(); return; } if (TextUtils.isEmpty(mEtEmail.getText().toString().trim())) { mEtEmail.setShakeAnimation(); Toast.makeText(mContext, "请输入邮箱地址", Toast.LENGTH_SHORT).show(); return; } if (!StringUtils.isValidEmail(mEtEmail.getText())) { mEtEmail.setShakeAnimation(); Toast.makeText(mContext, "邮箱格式不正确", Toast.LENGTH_SHORT).show(); return; } userProxy.setOnSignUpListener(this); LogUtils.i(TAG, "register begin...."); userProxy.signUp( mEtUserName.getText().toString().trim(), ActivityUtil.Md5(mEtPassword.getText().toString().trim()), mEtEmail.getText().toString().trim()); break; } }
@Override public void onSignUpSuccess() { // TODO Auto-generated method stub ActivityUtil.show(this, "注册成功"); LogUtils.i(TAG, "register successed!"); this.finish(); }
@Override public void onSignUpFailure(String msg) { // TODO Auto-generated method stub ActivityUtil.show(this, msg); LogUtils.i(TAG, "register failed!"); }