@Override protected void onPostExecute(JSONObject result) { if (Config.DEBUG) Log.d("Create Alert", result.toString()); Boolean success = false; String message = ""; try { success = result.getBoolean("success"); message = result.getString("message"); } catch (Exception e) { e.printStackTrace(); message = context.getString(R.string.json_error); success = false; } if (success) { handler.onSuccess(); } else { MemetroDialog.showDialog(context, null, message); handler.onFailure(); } handler.onFinish(); }
@Override protected void onPostExecute(Boolean result) { if (result) { handler.onSuccess(); } else { handler.onFailure(); } handler.onFinish(); }
protected void onPostExecute(JSONObject result) { if (Config.DEBUG) Log.d("Login", result.toString()); // Trying to get the token... try { String token = result.getString("access_token"); String refresh_token = result.getString("refresh_token"); Utils.setToken(context, token, refresh_token); handler.onSuccess(); } catch (Exception e) { // Token failed if (Config.DEBUG) Log.d("Login", "Login failed. Cause: " + e.toString()); handler.onFailure(); } handler.onFinish(); }