app/src/main/java/de/ahlfeld/breminale/app/core/DataManager.java
public boolean shouldLoadData() {
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this.context.getApplicationContext());
        long lastUpdate = preferences.getLong(LAST_UPDATE, 0);
        Date now = new Date();
        if(lastUpdate <= 0) {
            return true;
        }
        else if(now.getTime() - lastUpdate >= FIVE_HOURS_IN_MS) {
            return  true;
        } else {
            return false;
        }
    }
/**
     * Returns true if data was never been loaded or the last update is more then 5 hours ago.
     * @return
     */
Returns true if data was never been loaded or the last update is more then 5 hours ago.
@return
Returns true if data was never been loaded or the last update is more then 5 hours ago . @return
public boolean shouldLoadData() {
        SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this.context.getApplicationContext());
        long lastUpdate = preferences.getLong(LAST_UPDATE, 0);
        Date now = new Date();
        if(lastUpdate <= 0) {
            return true;
        }
        else if(now.getTime() - lastUpdate >= FIVE_HOURS_IN_MS) {
            return  true;
        } else {
            return false;
        }
    }
public boolean shouldLoadData ( ) { SharedPreferences preferences = PreferenceManager . getDefaultSharedPreferences ( this . context . getApplicationContext ( ) ) ; long lastUpdate = preferences . getLong ( LAST_UPDATE , 0 ) ; Date now = new Date ( ) ; if ( lastUpdate <= 0 ) { return true ; } else if ( now . getTime ( ) - lastUpdate >= FIVE_HOURS_IN_MS ) { return true ; } else { return false ; } }
Returns true if data was never been loaded or the last update is more then 5 hours ago.
Returns true if data was never been loaded or the last update is more then 5 hours ago .