app/src/main/java/com/mensa/zhmensa/services/MensaManager.java
/**
     * MUST BE CALLED BEFORE ANY FUNCTION OF MENSAMANAGER IS USED!
     * Sets context to get Shared Preferences.
     *
     * @param context Context of the current activity
     */
MUST BE CALLED BEFORE ANY FUNCTION OF MENSAMANAGER IS USED.
Sets context to get Shared Preferences.

@param context Context of the current activity
MUST BE CALLED BEFORE ANY FUNCTION OF MENSAMANAGER IS USED . Sets context to get Shared Preferences . @param context Context of the current activity
public static void initManager(Context activityContext) {
            favoriteMensa = new FavoriteMensa(activityContext.getString(R.string.favorites_title));
            favoriteIds = new HashSet<>(activityContext.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE).getStringSet(FAVORITE_STORE_ID, new HashSet<String>()));
            HIDDEN_MENU_IDS = new HashSet<>(PreferenceManager.getDefaultSharedPreferences(activityContext).getStringSet(DELETED_MENUS_STORE_ID, new HashSet<String>()));
            SELECTED_DAY = Helper.getCurrentDay();
    }
public static void initManager ( Context activityContext ) { favoriteMensa = new FavoriteMensa ( activityContext . getString ( R . string . favorites_title ) ) ; favoriteIds = new HashSet < > ( activityContext . getSharedPreferences ( SHARED_PREFS_NAME , Context . MODE_PRIVATE ) . getStringSet ( FAVORITE_STORE_ID , new HashSet < String > ( ) ) ) ; HIDDEN_MENU_IDS = new HashSet < > ( PreferenceManager . getDefaultSharedPreferences ( activityContext ) . getStringSet ( DELETED_MENUS_STORE_ID , new HashSet < String > ( ) ) ) ; SELECTED_DAY = Helper . getCurrentDay ( ) ; }
MUST BE CALLED BEFORE ANY FUNCTION OF MENSAMANAGER IS USED!
MUST BE CALLED BEFORE ANY FUNCTION OF MENSAMANAGER IS USED!
// Load favorite Ids from shared Preferences. //HIDDEN_MENU_IDS = new HashSet<>(activityContext.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE).getStringSet(DELETED_MENUS_STORE_ID, new HashSet<String>()));