use of com.newsrob.LoginWithCaptchaRequiredException in project newsrob by marianokamp.
the class LoginParameters method onError.
private void onError(Exception ex) {
if (ex != null)
ex.printStackTrace();
if (ex instanceof LoginWithCaptchaRequiredException) {
LoginWithCaptchaRequiredException e = (LoginWithCaptchaRequiredException) ex;
configureView(e.getCaptchaToken(), e.getCaptchaUrl());
return;
}
configureView(null, null);
final AlertDialog dialog = new AlertDialog.Builder(LoginActivity.this).create();
dialog.setIcon(android.R.drawable.ic_dialog_alert);
dialog.setButton("OK", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
// i18n
dialog.setTitle(U.t(LoginActivity.this, R.string.login_error_dialog_title));
dialog.setMessage(U.t(LoginActivity.this, R.string.login_error_dialog_message) + " " + ex.getMessage() + "/n(" + ex.getClass() + // i18n
")");
try {
dialog.show();
} catch (BadTokenException e) {
//
}
// mUsername.setError(getString(R.string.screen_login_error));
}
Aggregations