use of ca.etsmtl.applets.etsmobile.http.AuthentificationPortailTask in project ETSMobile-Android2 by ApplETS.
the class LoginActivity method onRequestSuccess.
@Override
public void onRequestSuccess(Object o) {
showProgress(false);
if (o != null) {
Etudiant etudiant = (Etudiant) o;
if (etudiant.erreur != null) {
mPasswordView.setError(getString(R.string.error_invalid_pwd));
mPasswordView.requestFocus();
} else {
ApplicationManager.userCredentials = userCredentials;
TodayWidgetProvider.updateAllWidgets(this);
String accountName = userCredentials.getUsername();
String accountPassword = userCredentials.getPassword();
createETSMobileAccount(accountName, accountPassword);
startActivity(new Intent(LoginActivity.this, MainActivity.class));
//Run authentication to monETS in another thread not to slow app
new AuthentificationPortailTask(this).execute(getString(R.string.portail_api_authentification_url), ApplicationManager.userCredentials.getUsername(), ApplicationManager.userCredentials.getPassword());
finishActivity(1);
}
} else {
mPasswordView.setError(getString(R.string.error_invalid_email));
mPasswordView.requestFocus();
}
}
Aggregations