Source:
<code>public void callServerForLogin() { if (NetworkUtil.isConnected(this)) { emailStr = email_et.getText().toString().trim(); String passwordStr = password_et.getText().toString().trim(); if (email_et != null && emailStr.length() == 0) { showErrorMessage(getString(R.string.login_error), getString(R.string.error_enter_email)); email_et.requestFocus(); } else if (password_et != null && passwordStr.length() == 0) { showErrorMessage(getString(R.string.login_error), getString(R.string.error_enter_password)); password_et.requestFocus(); } else { email_et.setEnabled(false); password_et.setEnabled(false); forgotPassword_tv.setEnabled(false); eulaTv.setEnabled(false); clearDialogs(); LoginTask logintask = new LoginTask(this, email_et.getText().toString().trim(), password_et.getText().toString()) { @Override public void onSuccess(AuthResponse result) { try { if (result != null && result.hasValidProfile()) { onUserLoginSuccess(result.profile); } else { LoginErrorMessage errorMsg = new LoginErrorMessage( getString(R.string.login_error), getString(R.string.login_failed)); throw new LoginException(errorMsg); } } catch (LoginException ex) { super.onException(ex); <START> onUserLoginFailure(ex, null, null); <END> } } @Override public void onException(Exception ex) { super.onException(ex); } }; tryToSetUIInteraction(false); logintask.setProgressDialog(progressbar); logintask.execute(); } } else { showErrorMessage(getString(R.string.no_connectivity), getString(R.string.network_not_connected)); } }</code><technical_language>removing try catch block here, handling in onException() before? simplify centralize exception handling logic. previous implementation called onException(), I mistakenly changed super implementation call onUserLoginFailure() method</technical_language>

Target:
public void callServerForLogin() { if (NetworkUtil.isConnected(this)) { emailStr = email_et.getText().toString().trim(); String passwordStr = password_et.getText().toString().trim(); if (email_et != null && emailStr.length() == 0) { showErrorMessage(getString(R.string.login_error), getString(R.string.error_enter_email)); email_et.requestFocus(); } else if (password_et != null && passwordStr.length() == 0) { showErrorMessage(getString(R.string.login_error), getString(R.string.error_enter_password)); password_et.requestFocus(); } else { email_et.setEnabled(false); password_et.setEnabled(false); forgotPassword_tv.setEnabled(false); eulaTv.setEnabled(false); clearDialogs(); LoginTask logintask = new LoginTask(this, email_et.getText().toString().trim(), password_et.getText().toString()) { @Override public void onSuccess(AuthResponse result) { try { if (result != null && result.hasValidProfile()) { onUserLoginSuccess(result.profile); } else { LoginErrorMessage errorMsg = new LoginErrorMessage( getString(R.string.login_error), getString(R.string.login_failed)); throw new LoginException(errorMsg); } } catch (LoginException ex) { super.onException(ex); onUserLoginFailure(ex, null, null); } } @Override public void onException(Exception ex) { super.onException(ex); tryToSetUIInteraction(true); } }; tryToSetUIInteraction(false); logintask.setProgressDialog(progressbar); logintask.execute(); } } else { showErrorMessage(getString(R.string.no_connectivity), getString(R.string.network_not_connected)); } }