display proper error in edit account details if jid is invalid

This commit is contained in:
iNPUTmice 2014-12-03 10:52:55 +01:00
parent 8f62d95e1f
commit 685f405154

View File

@ -74,14 +74,15 @@ public class EditAccountActivity extends XmppActivity implements OnAccountUpdate
return; return;
} }
boolean registerNewAccount = mRegisterNew.isChecked(); boolean registerNewAccount = mRegisterNew.isChecked();
final Jid jid; final Jid jid;
try { try {
jid = Jid.fromString(mAccountJid.getText().toString()); jid = Jid.fromString(mAccountJid.getText().toString());
} catch (final InvalidJidException e) { } catch (final InvalidJidException e) {
// TODO: Handle this error? mAccountJid.setError(getString(R.string.invalid_jid));
return; mAccountJid.requestFocus();
} return;
String password = mPassword.getText().toString(); }
String password = mPassword.getText().toString();
String passwordConfirm = mPasswordConfirm.getText().toString(); String passwordConfirm = mPasswordConfirm.getText().toString();
if (registerNewAccount) { if (registerNewAccount) {
if (!password.equals(passwordConfirm)) { if (!password.equals(passwordConfirm)) {