@Override protected void onResult(FoodController controller, FoodResponse result) { if (result.getStatusCode() == FoodStatusCode.OK) { controller.setMealTypePicUrls(result.getMealTypePictureUrls()); controller.setServerDetectedPriceTarget(result.getUserStatus()); controller.setEpflMenus(result.getMenu()); keepInCache(); } else { caller.foodServersDown(); } }
@Override protected void onError(FoodController controller, Exception e) { if (foundInCache()) caller.networkErrorCacheExists(); else caller.networkErrorHappened(); e.printStackTrace(); }