1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| class MyAsyncTask extends AsyncTask<Void, Void, String> {
@Override
protected String doInBackground(Void... params) {
// Requête de set connection time
SetconnexionTime sct = new SetconnexionTime();
sct.userT = infosSession.idUser;
return webservice.SetconnexionTime(sct);
}
@Override
protected void onPostExecute(String result) {
try {
result = AESEncrypter.decryptTextFromBase64(result);
} catch (AESEncrypterException e) {
e.printStackTrace();
Log.e(TAG, "AESEncrypterException: " + e.getMessage());
error--;
}
Log.d(TAG, "result: " + result);
if (result.equals("1"))
error = maxError;
else
error--;
if (error == 0) {
errorManager.showToastShort(getBaseContext(), getString(R.string.set_connexion_time_error));
}
}
} |