@Override public boolean shouldUpdate() { long lastUpdate = mPreferences.lastPageUpdateTime(mLanguage, mLocation); long now = new Date().getTime(); long updateCachingTime = 1000 * 60 * 60 * 4; // 4 hours return now - lastUpdate > updateCachingTime; }
@Override public void loadedFromNetwork() { mPreferences.setLastPageUpdateTime(mLanguage, mLocation); }